Fix selection update in viless search

This commit is contained in:
Christian Duerr 2020-07-17 00:30:34 +00:00 committed by GitHub
parent 41127a1e72
commit f608fece45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -402,6 +402,11 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext<T> for ActionCon
#[inline]
fn push_search(&mut self, c: char) {
if let Some(regex) = self.search_state.regex.as_mut() {
// Prevent previous search selections from sticking around when not in vi mode.
if !self.terminal.mode().contains(TermMode::VI) {
self.terminal.selection = None;
}
regex.push(c);
self.update_search();
}