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
1 changed files with 5 additions and 1 deletions

View File

@ -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);
}