aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYan <yan@metatem.net>2017-11-04 05:37:31 +0100
committerJoe Wilm <jwilm@users.noreply.github.com>2017-11-11 09:23:43 -0800
commitd52e545db3a9757325002f2a3ffd232e791f0093 (patch)
tree96dd4e80b935f19af8e021aa337ec1a8e2a5ffa6
parent0bae7ae7227179d79e1f3a0378398a88bc3796cc (diff)
downloadalacritty-d52e545db3a9757325002f2a3ffd232e791f0093.tar.gz
alacritty-d52e545db3a9757325002f2a3ffd232e791f0093.zip
Correct linefeed handling when scroll region set (#855)
Linefeeds should only move the cursor down if it's before the end of the scroll region. The "out of bounds" panic was triggered by linefeeds going off the bottom of the screen when the scroll region end was above the cursor. Note: https://vt100.net/docs/vt102-ug/chapter5.html "Characters added outside the scrolling region do not cause the screen to scroll."
-rw-r--r--src/term/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs
index 7324d401..503d09ec 100644
--- a/src/term/mod.rs
+++ b/src/term/mod.rs
@@ -1452,7 +1452,9 @@ impl ansi::Handler for Term {
if (self.cursor.point.line + 1) == self.scroll_region.end {
self.scroll_up(Line(1));
} else {
- self.cursor.point.line += 1;
+ if (self.cursor.point.line + 1) < self.scroll_region.end {
+ self.cursor.point.line += 1;
+ }
}
}