From 82f7ee0a6d336f95ce6e07434ff09f5e68dc84a6 Mon Sep 17 00:00:00 2001 From: qkzk Date: Thu, 29 Feb 2024 17:27:11 +0100 Subject: FIX: leaving (with escape) should reset the filter, not leave --- src/app/tab.rs | 4 ++++ src/event/event_exec.rs | 6 ++++++ 2 files changed, 10 insertions(+) (limited to 'src') 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 { -- cgit v1.2.3