Use checked subtraction for backspace

Some shells will send a backspace at column 0, apparently.
This commit is contained in:
Joe Wilm 2016-12-10 10:14:45 -08:00
parent d19e6e38a4
commit b6c372ab48
1 changed files with 3 additions and 1 deletions

View File

@ -570,7 +570,9 @@ impl ansi::Handler for Term {
#[inline]
fn backspace(&mut self) {
debug_println!("backspace");
self.cursor.col -= 1;
if self.cursor.col > Column(0) {
self.cursor.col -= 1;
}
}
/// Carriage return