diff options
author | Joe Wilm <joe@jwilm.com> | 2017-11-11 08:45:17 -0800 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-11-11 09:23:43 -0800 |
commit | 7e8db8db1ad4eed894875a436c168fcfa8a04f8f (patch) | |
tree | fe3bc29248b98d60d62432837bb85374ca5d10d4 /src/term/mod.rs | |
parent | d52e545db3a9757325002f2a3ffd232e791f0093 (diff) | |
download | alacritty-7e8db8db1ad4eed894875a436c168fcfa8a04f8f.tar.gz alacritty-7e8db8db1ad4eed894875a436c168fcfa8a04f8f.zip |
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.
Diffstat (limited to 'src/term/mod.rs')
-rw-r--r-- | src/term/mod.rs | 9 |
1 files changed, 4 insertions, 5 deletions
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; } } |