From f9d610f4c2e7e851bf7ebad808a44d2ae0b4996e Mon Sep 17 00:00:00 2001 From: Ayose Date: Fri, 2 Apr 2021 19:15:38 +0100 Subject: Don't clear cells after the right side of the graphic. --- alacritty_terminal/src/term/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index 63a2e282..80e16e20 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -1847,6 +1847,9 @@ impl Handler for Term { let left = if scrolling { self.grid.cursor.point.column.0 } else { 0 }; + let graphic_columns = (graphic.width + self.cell_width - 1) / self.cell_width; + let right = min(self.columns(), left + graphic_columns); + let texture = Arc::new(TextureRef { id: graphic_id, remove_queue: Arc::downgrade(&self.graphics.remove_queue), @@ -1870,7 +1873,7 @@ impl Handler for Term { cell.set_graphic(graphic_cell); self.grid[line][Column(left)] = cell; - for col in left + 1..self.cols().0 { + for col in left + 1..right { self.grid[line][Column(col)] = Cell::default(); } -- cgit