From 319a5376e3d09587520f2550a9ca6e7e8655472c Mon Sep 17 00:00:00 2001 From: jonboh Date: Sun, 11 Feb 2024 10:38:39 +0100 Subject: [PATCH] shotgun fix images not being correctly removed from lines (for demonstration) Go through all cells removing the specified image. This could have extremely bad performance for large scrollbacks and a lot of updating images. The PlacementInfo should be sufficient to just remove the image from the relevant lines, but right now this PlacementInfo can become stale after resizing, which seems to indicate a bug. --- term/src/terminalstate/kitty.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/term/src/terminalstate/kitty.rs b/term/src/terminalstate/kitty.rs index 0282d37ca..c7657db19 100644 --- a/term/src/terminalstate/kitty.rs +++ b/term/src/terminalstate/kitty.rs @@ -301,9 +301,7 @@ impl TerminalState { ) { let seqno = self.seqno; let screen = self.screen_mut(); - let range = - screen.stable_range(&(info.first_row..info.first_row + info.rows as StableRowIndex)); - for idx in range { + for idx in 0..screen.scrollback_rows() { let line = screen.line_mut(idx); for c in line.cells_mut() { c.attrs_mut()