From 819b7e066d9fe52c45f10fc5954d6d64ffa01b48 Mon Sep 17 00:00:00 2001 From: moni Date: Sat, 21 Dec 2024 01:25:06 +0800 Subject: [PATCH] surface: don't early return when clearing hyperlinks When outside the viewport, other actions such as scrolling might be happening, and doing an early return when clearing hyperlinks prevents scrolling upwards. We do not early return so we can process scrolling when it happens. --- src/Surface.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Surface.zig b/src/Surface.zig index 9fc5b1d90..1442af869 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -3298,9 +3298,10 @@ pub fn cursorPosCallback( // No mouse point so we don't highlight links self.renderer_state.mouse.point = null; - self.renderer_state.terminal.screen.dirty.hyperlink_hover = true; - return; + // Mark the link's row as dirty, but continue with updating the + // mouse state below so we can scroll when our position is negative. + self.renderer_state.terminal.screen.dirty.hyperlink_hover = true; } // Always show the mouse again if it is hidden