diff options
| author | Joe Wilm <joe@jwilm.com> | 2016-08-19 17:55:44 -0700 |
|---|---|---|
| committer | Joe Wilm <joe@jwilm.com> | 2016-08-19 17:55:44 -0700 |
| commit | ad4d704ab37048116513a9b85f1ff9228fb3c7cf (patch) | |
| tree | 93fe2d2d77dbe0ef591d46535c645de0de772f77 /src | |
| parent | e3c68fed87cf4ea4fbce7bd94d14528cbb4f0822 (diff) | |
| download | r-alacritty-ad4d704ab37048116513a9b85f1ff9228fb3c7cf.tar.gz r-alacritty-ad4d704ab37048116513a9b85f1ff9228fb3c7cf.tar.bz2 r-alacritty-ad4d704ab37048116513a9b85f1ff9228fb3c7cf.zip | |
Fix corruption issue
Fixes an issue where input with the cursor at the bottom-right of the
terminal would cause a crash.
Diffstat (limited to 'src')
| -rw-r--r-- | src/term.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/term.rs b/src/term.rs index 691c5392..d31cf9ab 100644 --- a/src/term.rs +++ b/src/term.rs @@ -405,7 +405,11 @@ impl ansi::Handler for Term { debug_print!("{}", c); if self.cursor.col == self.grid.num_cols() { debug_println!("wrapping"); - self.cursor.line += 1; + if (self.cursor.line + 1) == self.grid.num_lines() { + self.linefeed(); + } else { + self.cursor.line += 1; + } self.cursor.col = Column(0); } |