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

Fix corruption issue

Fixes an issue where input with the cursor at the bottom-right of the
terminal would cause a crash.
This commit is contained in:
Joe Wilm 2016-08-19 17:55:44 -07:00
parent e3c68fed87
commit ad4d704ab3

View file

@ -405,7 +405,11 @@ impl ansi::Handler for Term {
debug_print!("{}", c); debug_print!("{}", c);
if self.cursor.col == self.grid.num_cols() { if self.cursor.col == self.grid.num_cols() {
debug_println!("wrapping"); debug_println!("wrapping");
if (self.cursor.line + 1) == self.grid.num_lines() {
self.linefeed();
} else {
self.cursor.line += 1; self.cursor.line += 1;
}
self.cursor.col = Column(0); self.cursor.col = Column(0);
} }