mirror of
https://github.com/alacritty/alacritty.git
synced 2025-08-07 22:12:25 -04:00
Fix terminal damage after leaving Vi mode
This fixes an issue when search results were not damaged when leaving Vi mode.
This commit is contained in:
parent
8f1abe13e6
commit
40b5e179a3
1 changed files with 9 additions and 3 deletions
|
@ -769,9 +769,15 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext<T> for ActionCon
|
||||||
#[inline]
|
#[inline]
|
||||||
fn toggle_vi_mode(&mut self) {
|
fn toggle_vi_mode(&mut self) {
|
||||||
if self.terminal.mode().contains(TermMode::VI) {
|
if self.terminal.mode().contains(TermMode::VI) {
|
||||||
// Damage line indicator and Vi cursor if we're leaving Vi mode.
|
// 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_vi_cursor();
|
||||||
self.terminal.damage_line(0, 0, self.terminal.columns() - 1);
|
self.terminal.damage_line(0, 0, self.terminal.columns() - 1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
self.clear_selection();
|
self.clear_selection();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue