diff options
author | DLFW <daniel@llin.info> | 2021-06-22 03:31:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-21 21:31:45 -0400 |
commit | a4b4a1b4b9c7827f756e9950d73dc885d2954ff9 (patch) | |
tree | 55e2ca0d4db9d9a1a47420efa8d7613723bc1a43 /src/ui | |
parent | 26a5ce4f627195d0f075d6ae102c0110e8bd83f1 (diff) |
show size of directories (#76)
The middle column shows the size of directories in terms of contained
files and sub-directories in the right label for each entry.
Invalid symlinks and hidden files/dirs are included in the count.
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/widgets/tui_dirlist_detailed.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ui/widgets/tui_dirlist_detailed.rs b/src/ui/widgets/tui_dirlist_detailed.rs index 08772bc..08777ed 100644 --- a/src/ui/widgets/tui_dirlist_detailed.rs +++ b/src/ui/widgets/tui_dirlist_detailed.rs @@ -81,7 +81,11 @@ fn print_entry( drawing_width: usize, ) { let size_string = match entry.metadata.file_type() { - FileType::Directory => String::from(""), + FileType::Directory => entry + .metadata + .directory_size() + .expect("Directory doesn't have size") + .to_string(), FileType::File => format::file_size_to_string(entry.metadata.len()), }; let symlink_string = match entry.metadata.link_type() { |