summaryrefslogtreecommitdiffstats
path: root/src/fs
diff options
context:
space:
mode:
authorJeff Zhao <jeff.no.zhao@gmail.com>2022-09-04 16:56:38 -0400
committerJeff Zhao <jeff.no.zhao@gmail.com>2022-09-04 16:56:38 -0400
commite76b9fb310ae9f2d5c0e8be8794aab5b1d9edd42 (patch)
treeadbff6e5a3ecfcb5a9e3e3c4721e917130f62a9f /src/fs
parent2e8e1ccdd52d5cdc4b461b4e576c5afc9bffd2c3 (diff)
show how many files are selected in the footer
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/dirlist.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fs/dirlist.rs b/src/fs/dirlist.rs
index 567b8eb..1d035fa 100644
--- a/src/fs/dirlist.rs
+++ b/src/fs/dirlist.rs
@@ -206,8 +206,8 @@ impl JoshutoDirList {
self.path.as_path()
}
- pub fn any_selected(&self) -> bool {
- self.contents.iter().any(|e| e.is_selected())
+ pub fn selected_count(&self) -> usize {
+ self.contents.iter().filter(|e| e.is_selected()).count()
}
pub fn iter_selected(&self) -> impl Iterator<Item = &JoshutoDirEntry> {