summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqkzk <qu3nt1n@gmail.com>2024-02-29 17:27:11 +0100
committerqkzk <qu3nt1n@gmail.com>2024-02-29 17:28:03 +0100
commit82f7ee0a6d336f95ce6e07434ff09f5e68dc84a6 (patch)
treefa178f36efc534206b1403c061a5238b70ab2dd0
parentd1596573ae19b7ed299bd844d8e82d8534179c68 (diff)
FIX: leaving (with escape) should reset the filter, not leave
-rw-r--r--development.md1
-rw-r--r--src/app/tab.rs4
-rw-r--r--src/event/event_exec.rs6
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 {