summaryrefslogtreecommitdiff
path: root/src/Surface.zig
diff options
context:
space:
mode:
authorBryan Lee <38807139+liby@users.noreply.github.com>2025-01-21 09:50:15 +0800
committerBryan Lee <38807139+liby@users.noreply.github.com>2025-01-22 02:49:37 +0800
commitbf6cce23da165c80622f7b12fefd3193d02c2d96 (patch)
treed31ad422b3d5326953da276011a68679001da705 /src/Surface.zig
parent5cb2fa6f7594202b12a2603bf32094aa75b1bf0e (diff)
Prevent hyperlink hover state when mouse is outside viewport
Diffstat (limited to 'src/Surface.zig')
-rw-r--r--src/Surface.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Surface.zig b/src/Surface.zig
index 138aa2ea2..d9a985aa7 100644
--- a/src/Surface.zig
+++ b/src/Surface.zig
@@ -1041,6 +1041,9 @@ fn mouseRefreshLinks(
pos_vp: terminal.point.Coordinate,
over_link: bool,
) !void {
+ // If the position is outside our viewport, do nothing
+ if (pos.x < 0 or pos.y < 0) return;
+
self.mouse.link_point = pos_vp;
if (try self.linkAtPos(pos)) |link| {