From bc60782e424359d818a22ffa2ffa3c2dc88ab6fe Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Wed, 1 Jul 2020 06:58:06 +0000 Subject: Fix reflow of empty wrapped cursor line This bug was caused by trying to grow the terminal while the cursor line was wrapped but entirely empty. Resizing the terminal now accounts for the position of the deleted line and moves the cursor up only when the line deleted was above it. The deletion of the line was caused by the shell redrawing itself whenever the cursor is moved. Fixes #3583. --- alacritty_terminal/src/term/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'alacritty_terminal/src/term/mod.rs') diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index bed3f1bc..16e4de92 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -1775,7 +1775,7 @@ impl Handler for Term { }, } - let cursor_buffer_line = self.grid.cursor_buffer_point().line; + let cursor_buffer_line = (self.grid.num_lines() - self.grid.cursor.point.line - 1).0; self.selection = self .selection .take() @@ -1858,7 +1858,7 @@ impl Handler for Term { let template = self.grid.cursor.template; let num_lines = self.grid.num_lines().0; - let cursor_buffer_line = self.grid.cursor_buffer_point().line; + let cursor_buffer_line = num_lines - self.grid.cursor.point.line.0 - 1; match mode { ansi::ClearMode::Above => { -- cgit