diff options
author | Christian Duerr <contact@christianduerr.com> | 2021-02-22 23:54:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-22 23:54:12 +0000 |
commit | 35e6fdaddd28e348e35832be534553bc81da0a80 (patch) | |
tree | 0aa90f4a713e8900f31cf62e1192a8b1a3b28435 /alacritty | |
parent | 369c927d9d08c97221c76fecef71cf08cea92c91 (diff) | |
download | r-alacritty-35e6fdaddd28e348e35832be534553bc81da0a80.tar.gz r-alacritty-35e6fdaddd28e348e35832be534553bc81da0a80.tar.bz2 r-alacritty-35e6fdaddd28e348e35832be534553bc81da0a80.zip |
Fix selection after search without match
This resolves an issue where the last match would be selected after
leaving non-vi search, even if further changes to the search regex did
not result in any matches.
Fixes #4831.
Diffstat (limited to 'alacritty')
-rw-r--r-- | alacritty/src/event.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index affb8f4c..de3be146 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -730,6 +730,9 @@ impl<'a, N: Notify + 'a, T: EventListener> ActionContext<'a, N, T> { // Unschedule pending timers. self.scheduler.unschedule(TimerId::DelayedSearch); + // Clear focused match. + self.search_state.focused_match = None; + // The viewport reset logic is only needed for vi mode, since without it our origin is // always at the current display offset instead of at the vi cursor position which we need // to recover to. @@ -741,9 +744,6 @@ impl<'a, N: Notify + 'a, T: EventListener> ActionContext<'a, N, T> { self.terminal.scroll_display(Scroll::Delta(self.search_state.display_offset_delta)); self.search_state.display_offset_delta = 0; - // Clear focused match. - self.search_state.focused_match = None; - // Reset vi mode cursor. let mut origin = self.search_state.origin; origin.line = min(origin.line, self.terminal.screen_lines() - 1); |