From 6307162e4989d19e14b844c4d159c68d5aa75779 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 17 May 2024 16:46:30 -0400 Subject: [PATCH] small comment changes --- src/Surface.zig | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Surface.zig b/src/Surface.zig index 68f4b47c7..10e312502 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -725,7 +725,10 @@ fn modsChanged(self: *Surface, mods: input.Mods) void { defer self.renderer_state.mutex.unlock(); self.renderer_state.mouse.mods = self.mouseModsWithCapture(self.mouse.mods); - // We use the clear screen dirty flag to force a rebuild of all rows. + // We use the clear screen dirty flag to force a rebuild of all + // rows because changing mouse mods can affect the highlight state + // of a link. If there is no link this seems very wasteful but + // its really only one frame so it's not so bad. self.renderer_state.terminal.flags.dirty.clear = true; } @@ -2557,10 +2560,13 @@ pub fn cursorPosCallback( // between and including those as dirty, instead of just the row // containing the part the cursor is hovering. This can result in // a bit of jank. - if (self.renderer_state.terminal.screen.pages.pin(.{ .viewport = last_vp })) |pin| { + if (self.renderer_state.terminal.screen.pages.pin(.{ + .viewport = last_vp, + })) |pin| { pin.markDirty(); } } + // If our last link viewport point is unchanged, then don't process // links. This avoids constantly reprocessing regular expressions // for every pixel change.