aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2022-02-02 20:20:14 +0300
committerGitHub <noreply@github.com>2022-02-02 20:20:14 +0300
commit40b5e179a3d92e6cbd6cee4b68905f87e47bb12c (patch)
treec43e73025668902ef4b0d23f55e4ddccaab37bb7 /alacritty/src
parent8f1abe13e6b80da181ee856e6d5a19c7731dbedc (diff)
downloadr-alacritty-40b5e179a3d92e6cbd6cee4b68905f87e47bb12c.tar.gz
r-alacritty-40b5e179a3d92e6cbd6cee4b68905f87e47bb12c.tar.bz2
r-alacritty-40b5e179a3d92e6cbd6cee4b68905f87e47bb12c.zip
Fix terminal damage after leaving Vi mode
This fixes an issue when search results were not damaged when leaving Vi mode.
Diffstat (limited to 'alacritty/src')
-rw-r--r--alacritty/src/event.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs
index 8bd1dec7..6885415f 100644
--- a/alacritty/src/event.rs
+++ b/alacritty/src/event.rs
@@ -769,9 +769,15 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext<T> for ActionCon
#[inline]
fn toggle_vi_mode(&mut self) {
if self.terminal.mode().contains(TermMode::VI) {
- // Damage line indicator and Vi cursor if we're leaving Vi mode.
- self.terminal.damage_vi_cursor();
- self.terminal.damage_line(0, 0, self.terminal.columns() - 1);
+ // 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() {
+ self.terminal.mark_fully_damaged();
+ } else {
+ // Damage line indicator and Vi cursor.
+ self.terminal.damage_vi_cursor();
+ self.terminal.damage_line(0, 0, self.terminal.columns() - 1);
+ }
} else {
self.clear_selection();
}