diff options
author | Kirill Chibisov <wchibisovkirill@gmail.com> | 2019-06-22 02:00:01 +0300 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-06-21 23:00:01 +0000 |
commit | 72088dafec44764630ac676440a0ec7e525a767b (patch) | |
tree | 446209882ea8f7854d77bff87cd3362d1174dadf /alacritty_terminal/src/term/mod.rs | |
parent | 6013d1ec3e396af51c25a005c7ef2ea66e6adfe9 (diff) | |
download | alacritty-72088dafec44764630ac676440a0ec7e525a767b.tar.gz alacritty-72088dafec44764630ac676440a0ec7e525a767b.zip |
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.
Diffstat (limited to 'alacritty_terminal/src/term/mod.rs')
-rw-r--r-- | alacritty_terminal/src/term/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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 = |