diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2022-05-03 15:36:41 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2022-05-03 15:36:41 -0400 |
commit | c15f5f46c7a5cb7d7830eed4b524775c863bba55 (patch) | |
tree | da0125b4cfa59524b34f9796ec21c0e98200e552 /src/commands | |
parent | 63c60d69c906bfae52f05d6ee22023c9ae7f15c1 (diff) |
inform user how many files was selected when glob selecting
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/selection.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/commands/selection.rs b/src/commands/selection.rs index 99f2471..a4d26c4 100644 --- a/src/commands/selection.rs +++ b/src/commands/selection.rs @@ -57,10 +57,12 @@ fn select_with_pattern( let glob = Glob::new(pattern)?.compile_matcher(); if let Some(curr_list) = context.tab_context_mut().curr_tab_mut().curr_list_mut() { + let mut found = 0; curr_list .iter_mut() .filter(|e| glob.is_match(e.file_name())) .for_each(|e| { + found += 1; if options.reverse { e.set_selected(false); } else if options.toggle { @@ -69,6 +71,9 @@ fn select_with_pattern( e.set_selected(true); } }); + context + .message_queue_mut() + .push_info(format!("{} files selected", found)); } Ok(()) } |