1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-11 13:51:01 -05:00

Fix CSI Ps M deleting lines above cursor

Fixes #2984.
This commit is contained in:
Christian Duerr 2019-11-15 20:38:52 +01:00
parent 561063b560
commit 2a8c6d44e9
No known key found for this signature in database
GPG key ID: 85CDAE3C164BA7B4
2 changed files with 6 additions and 2 deletions

View file

@ -80,6 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Terminal going transparent during visual bell - Terminal going transparent during visual bell
- Selection not being cleared when sending chars through a binding - Selection not being cleared when sending chars through a binding
- Mouse protocols/encodings not being mutually exclusive within themselves - Mouse protocols/encodings not being mutually exclusive within themselves
- Escape `CSI Ps M` deleting lines above cursor when at the bottom of the viewport
### Removed ### Removed

View file

@ -1564,9 +1564,12 @@ impl<T: EventListener> ansi::Handler for Term<T> {
#[inline] #[inline]
fn delete_lines(&mut self, lines: Line) { fn delete_lines(&mut self, lines: Line) {
let origin = self.cursor.point.line;
let lines = min(self.lines() - origin, lines);
trace!("Deleting {} lines", 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); self.scroll_up_relative(origin, lines);
} }
} }