Fix newline + scroll region bug (#747)

When a scroll region is active with the cursor below the bottom of the
region, newlines should not cause the region to scroll.

A ref test was added for this situation to prevent regressions.

Thanks @hiciu for reporting and @nicm for the test case.

Resolves #745.
This commit is contained in:
Joe Wilm 2017-08-22 11:24:33 -07:00 committed by GitHub
parent 471237d2ce
commit 87468b5c00
4 changed files with 7 additions and 1 deletions

View File

@ -1405,7 +1405,7 @@ impl ansi::Handler for Term {
#[inline]
fn linefeed(&mut self) {
trace!("linefeed");
if (self.cursor.point.line + 1) >= self.scroll_region.end {
if (self.cursor.point.line + 1) == self.scroll_region.end {
self.scroll_up(Line(1));
} else {
self.cursor.point.line += 1;

View File

@ -0,0 +1,4 @@
% ]2;jwilm@jwilm-desk: ~/code/alacritty]1;..ode/alacritty jwilm@jwilm-desk ➜  ~/code/alacritty  [?1h=[?2004h
bck-i-search: _clear; cat ~/Downloads/xtest.txt; sleep 100c_caa_att_clearcat ~/Downloads/xtest.txtsleep [?1l>[?2004l ]2;clear; cat ~/Downloads/xtest.txt; sleep 100]1;clear;
 58 getprogname());  59 exit 9 9
 59 !!!!

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{"width":587.0,"height":360.0,"cell_width":7.0,"cell_height":16.0,"padding_x":3.0,"padding_y":3.0}