summaryrefslogtreecommitdiffstats
path: root/src/interactive/app
diff options
context:
space:
mode:
authorPiotr Wach <pwach@bloomberg.net>2024-01-14 21:18:28 +0000
committerPiotr Wach <pwach@bloomberg.net>2024-01-14 21:19:59 +0000
commitc3d665d40264c819be66a5e290a87fb9f2007cf8 (patch)
treec4103a1c503a015a103fb1d7bb1f350cece8937a /src/interactive/app
parentad7abd83261d5db6b59fbf9d55a24020c531f157 (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.
Diffstat (limited to 'src/interactive/app')
-rw-r--r--src/interactive/app/eventloop.rs8
1 files changed, 7 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)