File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
lib/Terminal/Widgets/Volatile Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 22
33unit module Terminal::Widgets::Volatile::DirTree ;
44
5+ use nano;
6+
7+ use Terminal::Widgets::Common;
58use Terminal::Widgets::Volatile::Tree;
69
710constant VTree = Terminal::Widgets::Volatile::Tree;
@@ -40,7 +43,7 @@ class SymLink does Node {
4043 }
4144}
4245
43- class Dir does Parent {
46+ class Dir does Parent does Terminal::Widgets::Common {
4447 has VTree::Node: D @ ! children is built;
4548 has Instant : D $ . cache-time .= from-posix-nanos(0 );
4649
@@ -51,12 +54,17 @@ class Dir does Parent {
5154 method children (::? CLASS: D : Bool : D : $ refresh = False ) {
5255 # XXXX: For now, just fake real caching and be lazy
5356 if $ refresh || ! $ ! cache-time {
57+ my $ t0 = nano;
58+
5459 $ ! cache-time = now;
5560
5661 # Directory read may fail due to insufficient permissions
5762 try my @ entries = $ ! path . dir ;
5863
5964 @ ! children = @ entries . map ({ dir-tree-node($ _ , parent => self ) });
65+
66+ self . debug-elapsed($ t0 , icon => ' 💲' ,
67+ desc => " Refill children for dir { self . short-name. raku} " );
6068 }
6169 @ ! children
6270 }
You can’t perform that action at this time.
0 commit comments