diff options
author | Canop <cano.petrole@gmail.com> | 2020-08-18 14:35:20 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-08-18 14:35:20 +0200 |
commit | db2da21a7629f9685f4d062895e5d02db59ca80d (patch) | |
tree | 6457be9e35cf383cdd4a8c5713ace2d2c616eebf /src/browser/browser_state.rs | |
parent | bf25ceb834c2eb9aaa74d4d58936b3b1f81aed3e (diff) |
removing a filter using the esc key in tree tries to keep selection
Diffstat (limited to 'src/browser/browser_state.rs')
-rw-r--r-- | src/browser/browser_state.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/browser/browser_state.rs b/src/browser/browser_state.rs index 1a937d8..04dcc6a 100644 --- a/src/browser/browser_state.rs +++ b/src/browser/browser_state.rs @@ -314,7 +314,9 @@ impl AppState for BrowserState { .unwrap_or(internal_exec.bang); Ok(match internal_exec.internal { Internal::back => { - if self.filtered_tree.is_some() { + if let Some(filtered_tree) = &self.filtered_tree { + let filtered_selection = &filtered_tree.selected_line().path; + self.tree.try_select_path(filtered_selection); self.filtered_tree = None; AppStateCmdResult::Keep } else if self.tree.selection > 0 { |