fix(strider): clear search term on ESC (#2531)
This commit is contained in:
parent
09e8da6a3a
commit
b0a003dfc6
2 changed files with 10 additions and 4 deletions
|
|
@ -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…
Add table
Reference in a new issue