File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
lib/Terminal/Widgets/Volatile Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ role Node {
77 has IO ::Path: D () $ . path is required ;
88 has Node $ . parent ;
99
10- method gist () {
10+
11+ # | Simplified gist that does not traverse parents
12+ method gist (::? CLASS: D : ) {
1113 my $ short-name = self .^ name . subst (' Terminal::Widgets::Volatile::' , ' ' );
1214 $ short-name ~ ' :' ~ $ ! path . path
1315 }
@@ -22,7 +24,9 @@ class File does Node {
2224class SymLink does Node {
2325 has IO ::Path: D () $ . target is required ;
2426
25- method gist () {
27+
28+ # | Standard node gist plus target
29+ method gist (::? CLASS: D : ) {
2630 self . Node:: gist ~ ' => ' ~ $ ! target . path
2731 }
2832}
@@ -31,7 +35,9 @@ class Dir does Node {
3135 has Node: D @ ! children is built;
3236 has Instant : D $ . cache-time .= from-posix-nanos(0 );
3337
34- method children (Bool : D : $ refresh = False ) {
38+
39+ # | Lazily find (and cache) children, forcing a refresh if requested
40+ method children (::? CLASS: D : Bool : D : $ refresh = False ) {
3541 # XXXX: For now, just fake real caching and be lazy
3642 if $ refresh || ! $ ! cache-time {
3743 $ ! cache-time = now;
You can’t perform that action at this time.
0 commit comments