From b448501bf40d705beac05d638ed9856d9009741f Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Fri, 1 Dec 2023 10:06:27 -0600 Subject: [PATCH] Preserve cursor shape when over a link If mouse events are active and the cursor is hovered over a link, pressing Shift does not change the cursor to a pointer, but to the text selection shape, until the cursor is moved again. The pointer shape should have higher priority over the text selection shape when the cursor is hovered over a pointer. --- src/Surface.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Surface.zig b/src/Surface.zig index 1ab1cf2e8..b6a74beed 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -1252,7 +1252,11 @@ pub fn keyCallback( event.physical_key == .right_shift) { switch (event.action) { - .press => try self.rt_surface.setMouseShape(.text), + .press => if (!self.mouse.over_link) { + // If the cursor is over a link then the pointer shape takes + // priority + try self.rt_surface.setMouseShape(.text); + }, .release => try self.rt_surface.setMouseShape(self.io.terminal.mouse_shape), .repeat => {}, }