1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2025-04-14 17:53:03 -04:00

Handle overflow in Term::move_backward

Resolves #25
This commit is contained in:
Joe Wilm 2016-12-15 09:09:49 -08:00
parent 1a1b740c38
commit 0b3d2dac44

View file

@ -557,7 +557,11 @@ impl ansi::Handler for Term {
#[inline]
fn move_backward(&mut self, cols: Column) {
debug_println!("move_backward: {}", cols);
self.cursor.col -= cols;
if cols > self.cursor.col {
self.cursor.col = Column(0);
} else {
self.cursor.col -= cols;
}
}
#[inline]