From 6716c81c08c10477d2370d7e1ca56e31348a7fa3 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Fri, 19 Apr 2019 12:07:56 +0000 Subject: Fix update_lines performance issues This resolves performance issues with the `update_lines` method that were caused by excessive updates without underlines or strikeout present. This also resolves a bug that was causing the underline and strikeout to extend beyond the end of line in some rare cases. This fixes #114. --- src/term/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/term') diff --git a/src/term/mod.rs b/src/term/mod.rs index 3178de4c..48eedef1 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -1318,7 +1318,9 @@ impl Term { lines = min(lines, self.scroll_region.end - origin); // Scroll between origin and bottom - self.grid.scroll_down(&(origin..self.scroll_region.end), lines, &self.cursor.template); + let mut template = self.cursor.template; + template.flags = Flags::empty(); + self.grid.scroll_down(&(origin..self.scroll_region.end), lines, &template); } /// Scroll screen up @@ -1331,7 +1333,9 @@ impl Term { let lines = min(lines, self.scroll_region.end - self.scroll_region.start); // Scroll from origin to bottom less number of lines - self.grid.scroll_up(&(origin..self.scroll_region.end), lines, &self.cursor.template); + let mut template = self.cursor.template; + template.flags = Flags::empty(); + self.grid.scroll_up(&(origin..self.scroll_region.end), lines, &template); } fn deccolm(&mut self) { -- cgit v1.2.3-54-g00ecf