From 72088dafec44764630ac676440a0ec7e525a767b Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Sat, 22 Jun 2019 02:00:01 +0300 Subject: Fix inconsitent cursor position when scrolling This commit fixes regression introduced in cfc20d4f34dca535654cc32df18e785296af4cc5. `self.cursor.line` forced the cursor to hold a fixed location while scrolling until its "original" location (usually the shell prompt) went off the screen. So cursor position should be keep updated, which can be achieved by using `self.inner.line()`. Fixes #2570. --- alacritty_terminal/src/term/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'alacritty_terminal/src/term') diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index 378b3156..ee257272 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -436,7 +436,10 @@ impl<'a> Iterator for RenderableCellsIter<'a> { let cell = Indexed { inner: self.grid[self.cursor], column: self.cursor.col, - line: self.cursor.line, + // Using `self.cursor.line` leads to inconsitent cursor position when + // scrolling. See https://github.com/jwilm/alacritty/issues/2570 for more + // info. + line: self.inner.line(), }; let mut renderable_cell = -- cgit v1.2.3-54-g00ecf