From 65696c99009a774a5c3513e6533a404fe57875e7 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 21 Mar 2024 21:30:52 -0700 Subject: [PATCH] terminal: clearcells only decs cursor ref if same page --- src/terminal/Screen.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig index adac2951e..bf16e25c8 100644 --- a/src/terminal/Screen.zig +++ b/src/terminal/Screen.zig @@ -821,7 +821,9 @@ pub fn clearCells( // Fast-path, the style ID matches, in this case we just update // our own ref and continue. We never delete because our style // is still active. - if (cell.style_id == self.cursor.style_id) { + if (page == &self.cursor.page_pin.page.data and + cell.style_id == self.cursor.style_id) + { self.cursor.style_ref.?.* -= 1; continue; }