diff --git a/src/xwin.rs b/src/xwin.rs index 15a457fb8..d7ac32452 100644 --- a/src/xwin.rs +++ b/src/xwin.rs @@ -949,10 +949,9 @@ impl<'a> TerminalWindow<'a> { let (r, g, b, a) = background_color.to_linear_tuple_rgba(); target.clear_color(r, g, b, a); - self.terminal.make_all_lines_dirty(); let cursor = self.terminal.cursor_pos(); { - let dirty_lines = self.terminal.get_dirty_lines(); + let dirty_lines = self.terminal.get_dirty_lines(true); for (line_idx, line, selrange) in dirty_lines { self.render_line( diff --git a/term/src/terminalstate.rs b/term/src/terminalstate.rs index a3a2023b4..fdad1590b 100644 --- a/term/src/terminalstate.rs +++ b/term/src/terminalstate.rs @@ -640,7 +640,7 @@ impl TerminalState { /// line_idx is relative to the top of the viewport. /// The selrange value is the column range representing the selected /// columns on this line. - pub fn get_dirty_lines(&self) -> Vec<(usize, &Line, Range)> { + pub fn get_dirty_lines(&self, get_all: bool) -> Vec<(usize, &Line, Range)> { let mut res = Vec::new(); let screen = self.screen(); @@ -650,7 +650,7 @@ impl TerminalState { let selection = self.selection_range.map(|r| r.normalize()); for (i, mut line) in screen.lines.iter().skip(len - height).enumerate() { - if line.is_dirty() { + if get_all || line.is_dirty() { let selrange = match selection { None => 0..0, Some(sel) => { diff --git a/term/src/test/mod.rs b/term/src/test/mod.rs index a7fffde60..c4a03aea8 100644 --- a/term/src/test/mod.rs +++ b/term/src/test/mod.rs @@ -191,7 +191,10 @@ impl TestTerm { } fn assert_dirty_lines(&self, expected: &[usize], reason: Option<&str>) { - let dirty_indices: Vec = self.get_dirty_lines().iter().map(|&(i, ..)| i).collect(); + let dirty_indices: Vec = self.get_dirty_lines(false) + .iter() + .map(|&(i, ..)| i) + .collect(); assert_eq!( &dirty_indices, &expected,