diff options
author | a5ob7r <12132068+a5ob7r@users.noreply.github.com> | 2022-05-23 09:01:46 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-23 00:01:46 +0000 |
commit | c10888b0f09970d5def03f81b109f262b6f0b015 (patch) | |
tree | b9e948ba909d301ec519bbdfda30e1e1c16dced1 | |
parent | 394b3ffd81de2fc73335beeb8fca773cabf34cac (diff) | |
download | alacritty-c10888b0f09970d5def03f81b109f262b6f0b015.tar.gz alacritty-c10888b0f09970d5def03f81b109f262b6f0b015.zip |
Fix selection change after leaving vi-mode
This patch fixes that the right point of the selection range moves to
another point when leaves vi-mode with a selection by ToggleViMode.
The cause is that always moves a vi-mode cursor to a search origin
whether or not the current search is active.
This problem is a regression which is introduced by #5945.
-rw-r--r-- | alacritty/src/event.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index c645a526..9d6f843c 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -770,7 +770,7 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext<T> for ActionCon if self.terminal.mode().contains(TermMode::VI) { // If we had search running when leaving Vi mode we should mark terminal fully damaged // to cleanup highlighted results. - if self.search_state.dfas().is_some() { + if self.search_state.dfas.take().is_some() { self.terminal.mark_fully_damaged(); } else { // Damage line indicator and Vi cursor. @@ -781,7 +781,10 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext<T> for ActionCon self.clear_selection(); } - self.cancel_search(); + if self.search_active() { + self.cancel_search(); + } + self.terminal.toggle_vi_mode(); *self.dirty = true; |