Skip to content

Commit 7117ce2

Browse files
committed
Default DirTree sort to *.short-name
1 parent d18857e commit 7117ce2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Terminal/Widgets/Viewer/DirTree.rakumod

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ class Terminal::Widgets::Viewer::DirTree
1111
is Terminal::Widgets::Viewer::Tree {
1212
has Color::DirColors:D $.dir-colors .= new-from-env;
1313

14+
submethod TWEAK() {
15+
self.set-sort-by(*.short-name) unless self.sort-by;
16+
}
17+
1418
#| Displayed content for a given node itself, not including children
1519
method node-content($node) {
1620
my $color = $.dir-colors.color-for($node.data.path);

0 commit comments

Comments
 (0)