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

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."
This commit is contained in:
Yan 2017-11-04 05:37:31 +01:00 committed by Joe Wilm
parent 0bae7ae722
commit d52e545db3

View file

@ -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;
}
}
}