aboutsummaryrefslogtreecommitdiff
path: root/src/term/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/term/mod.rs')
-rw-r--r--src/term/mod.rs19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs
index 227e90d2..6cbd07d7 100644
--- a/src/term/mod.rs
+++ b/src/term/mod.rs
@@ -696,12 +696,10 @@ impl Term {
let grid = Grid::new(num_lines, num_cols, &template);
- let mut tabs = IndexRange::from(Column(0)..grid.num_cols())
+ let tabs = IndexRange::from(Column(0)..grid.num_cols())
.map(|i| (*i as usize) % TAB_SPACES == 0)
.collect::<Vec<bool>>();
- tabs[0] = false;
-
let alt = grid.clone();
let scroll_region = Line(0)..grid.num_lines();
@@ -1039,8 +1037,6 @@ impl Term {
.map(|i| (*i as usize) % TAB_SPACES == 0)
.collect::<Vec<bool>>();
- self.tabs[0] = false;
-
if num_lines > old_lines {
// Make sure bottom of terminal is clear
let template = self.empty_cell;
@@ -1531,7 +1527,18 @@ impl ansi::Handler for Term {
#[inline]
fn move_backward_tabs(&mut self, count: i64) {
- trace!("[unimplemented] move_backward_tabs: {}", count);
+ trace!("move_backward_tabs: {}", count);
+
+ for _ in 0..count {
+ let mut col = self.cursor.point.col;
+ for i in (0..(col.0)).rev() {
+ if self.tabs[i as usize] {
+ col = index::Column(i);
+ break;
+ }
+ }
+ self.cursor.point.col = col;
+ }
}
#[inline]