diff options
author | Christian Duerr <contact@christianduerr.com> | 2019-11-15 20:38:52 +0100 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2019-11-15 20:58:03 +0100 |
commit | 2a8c6d44e9ccf57dec4188938188d8360b06d862 (patch) | |
tree | dde15bbfee9f2cabe095fdb8befa75f2dfc8f875 /alacritty_terminal/src/term/mod.rs | |
parent | 561063b5606746936ee64d2f25a8b49c05a8d52e (diff) | |
download | alacritty-2a8c6d44e9ccf57dec4188938188d8360b06d862.tar.gz alacritty-2a8c6d44e9ccf57dec4188938188d8360b06d862.zip |
Fix `CSI Ps M` deleting lines above cursor
Fixes #2984.
Diffstat (limited to 'alacritty_terminal/src/term/mod.rs')
-rw-r--r-- | alacritty_terminal/src/term/mod.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index 063897cf..f0f38941 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -1564,9 +1564,12 @@ impl<T: EventListener> ansi::Handler for Term<T> { #[inline] fn delete_lines(&mut self, lines: Line) { + let origin = self.cursor.point.line; + let lines = min(self.lines() - origin, lines); + trace!("Deleting {} lines", lines); - if self.scroll_region.contains(&self.cursor.point.line) { - let origin = self.cursor.point.line; + + if lines.0 > 0 && self.scroll_region.contains(&self.cursor.point.line) { self.scroll_up_relative(origin, lines); } } |