From 7e8db8db1ad4eed894875a436c168fcfa8a04f8f Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Sat, 11 Nov 2017 08:45:17 -0800 Subject: Match LF behavior outside scroll region with urxvt Outside of a scroll region, linefeed will still advances the line until reaching the bottom row in other terminals. Alacritty now matches that. --- src/term/mod.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/term/mod.rs b/src/term/mod.rs index 503d09ec..51620762 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -1449,12 +1449,11 @@ impl ansi::Handler for Term { #[inline] fn linefeed(&mut self) { trace!("linefeed"); - if (self.cursor.point.line + 1) == self.scroll_region.end { + let next = self.cursor.point.line + 1; + if next == self.scroll_region.end { self.scroll_up(Line(1)); - } else { - if (self.cursor.point.line + 1) < self.scroll_region.end { - self.cursor.point.line += 1; - } + } else if next < self.grid.num_lines() { + self.cursor.point.line += 1; } } -- cgit