diff options
-rw-r--r-- | development.md | 1 | ||||
-rw-r--r-- | src/app/tab.rs | 4 | ||||
-rw-r--r-- | src/event/event_exec.rs | 6 |
3 files changed, 11 insertions, 0 deletions
diff --git a/development.md b/development.md index a3e5d82..7a36781 100644 --- a/development.md +++ b/development.md @@ -938,6 +938,7 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally. - [x] FIX: in dual pane mode, right aligned elements aren't displayed. - [x] FIX: Right pane search & filter click don't match on correct position. - [x] dynamic filtering while typing +- [x] FIX: leaving (with escape) should reset the filter, not leave - [x] setting a filter reset the "found" searched path & index ## TODO diff --git a/src/app/tab.rs b/src/app/tab.rs index ffa887a..cbc90dd 100644 --- a/src/app/tab.rs +++ b/src/app/tab.rs @@ -51,6 +51,10 @@ impl TabSettings { self.filter = filter } + pub fn reset_filter(&mut self) { + self.filter = FilterKind::All; + } + /// Update the kind of sort from a char typed by the user. fn update_sort_from_char(&mut self, c: char) { self.sort_kind.update_from_char(c) diff --git a/src/event/event_exec.rs b/src/event/event_exec.rs index ee8bad6..b053c7e 100644 --- a/src/event/event_exec.rs +++ b/src/event/event_exec.rs @@ -70,6 +70,12 @@ impl EventAction { /// Reset the inputs and completion, reset the window, exit the preview. pub fn reset_mode(status: &mut Status) -> Result<()> { if !matches!(status.current_tab().edit_mode, Edit::Nothing) { + if matches!( + status.current_tab().edit_mode, + Edit::InputSimple(InputSimple::Filter) + ) { + status.current_tab_mut().settings.reset_filter() + } if status.reset_edit_mode()? { status.tabs[status.index].refresh_view()?; } else { |