diff options
author | Piotr Wach <pwach@bloomberg.net> | 2024-01-14 21:18:28 +0000 |
---|---|---|
committer | Piotr Wach <pwach@bloomberg.net> | 2024-01-14 21:19:59 +0000 |
commit | c3d665d40264c819be66a5e290a87fb9f2007cf8 (patch) | |
tree | c4103a1c503a015a103fb1d7bb1f350cece8937a | |
parent | ad7abd83261d5db6b59fbf9d55a24020c531f157 (diff) |
Various updates based on the code review feedback:
* Added keys to the Help page.
* Starting a new traversal is blocked if another traversal is already running.
* Glob search is blocked if traversal is already running.
-rw-r--r-- | src/interactive/app/eventloop.rs | 8 | ||||
-rw-r--r-- | src/interactive/widgets/help.rs | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/interactive/app/eventloop.rs b/src/interactive/app/eventloop.rs index 2c00fd5..4ff3c05 100644 --- a/src/interactive/app/eventloop.rs +++ b/src/interactive/app/eventloop.rs @@ -226,7 +226,7 @@ impl AppState { Tab => { self.cycle_focus(window); } - Char('/') if !glob_focussed => { + Char('/') if !glob_focussed && self.active_traversal.is_none() => { self.toggle_glob_search(window); } Char('?') if !glob_focussed => self.toggle_help_pane(window), @@ -324,6 +324,12 @@ impl AppState { window: &mut MainWindow, what: Refresh, ) -> anyhow::Result<()> { + // If another traversal is already running do not do anything. + if self.active_traversal.is_some() { + return Ok(()); + } + + // If we are displaing root of the glob search results then cancel the search. if let Some(glob_tree_root) = tree.glob_tree_root { if glob_tree_root == self.navigation().view_root { self.quit_glob_mode(tree, window) diff --git a/src/interactive/widgets/help.rs b/src/interactive/widgets/help.rs index d5a481e..6bafe05 100644 --- a/src/interactive/widgets/help.rs +++ b/src/interactive/widgets/help.rs @@ -183,6 +183,8 @@ impl HelpPane { "Git-style glob search, case-insensitive.", Some("Search starts from the current directory."), ); + hotkey("r", "Refresh all items in the current view.", None); + hotkey("R", "Refresh only the selected item.", None); spacer(); } title("Mark items pane"); |