From a3d00f01b136ce95613bb20db9e05bfe9342185b Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Tue, 18 Apr 2017 10:42:29 -0700 Subject: Fixes for vttest cursor movement screen 1 --- src/term/mod.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/term/mod.rs') diff --git a/src/term/mod.rs b/src/term/mod.rs index 1e9201aa..990a574b 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -1100,6 +1100,19 @@ impl ansi::Handler for Term { } + #[inline] + fn dectest(&mut self) { + trace!("dectest"); + let mut template = self.cursor.template; + template.c = 'E'; + + for row in &mut self.grid.lines_mut() { + for cell in row { + cell.reset(&template); + } + } + } + #[inline] fn goto(&mut self, line: Line, col: Column) { trace!("goto: line={}, col={}", line, col); @@ -1471,7 +1484,8 @@ impl ansi::Handler for Term { } } // Clear up to the current column in the current line - for cell in &mut self.grid[self.cursor.point.line][..self.cursor.point.col] { + let end = min(self.cursor.point.col + 1, self.grid.num_cols()); + for cell in &mut self.grid[self.cursor.point.line][..end] { cell.reset(&template); } }, -- cgit