mirror of
https://github.com/zellij-org/zellij.git
synced 2024-11-23 19:10:09 +03:00
fix(strider): clear search term on ESC (#2531)
This commit is contained in:
parent
09e8da6a3a
commit
b0a003dfc6
@ -85,8 +85,11 @@ impl ZellijPlugin for State {
|
||||
},
|
||||
Event::Key(key) => match key {
|
||||
Key::Esc if self.typing_search_term() => {
|
||||
self.stop_typing_search_term();
|
||||
self.search_state.handle_key(key);
|
||||
if self.search_state.search_term.is_empty() {
|
||||
self.stop_typing_search_term();
|
||||
} else {
|
||||
self.search_state.handle_key(key);
|
||||
}
|
||||
should_render = true;
|
||||
},
|
||||
_ if self.typing_search_term() => {
|
||||
|
@ -36,8 +36,11 @@ impl SearchState {
|
||||
},
|
||||
Key::Ctrl('r') => self.toggle_search_filter(),
|
||||
Key::Esc => {
|
||||
hide_self();
|
||||
self.clear_state();
|
||||
if !self.search_term.is_empty() {
|
||||
self.clear_state();
|
||||
} else {
|
||||
hide_self();
|
||||
}
|
||||
},
|
||||
_ => self.append_to_search_term(key),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user