From f26b7533c65136ef3613af6f3904185bd861f09b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 7 May 2024 17:12:37 +0530 Subject: [PATCH] Fix off by one in hyperlink extent --- tools/tui/render_lines.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/tui/render_lines.go b/tools/tui/render_lines.go index 5450653c0..ea9f4e6d0 100644 --- a/tools/tui/render_lines.go +++ b/tools/tui/render_lines.go @@ -63,7 +63,10 @@ func (r RenderLines) InRectangle( if hyperlink_state.action == "" { return false } - mouse_state.AddCellRegion(hyperlink_state.action, hyperlink_state.start_x, hyperlink_state.start_y, x, y, on_click...) + if y == hyperlink_state.start_y && x <= hyperlink_state.start_x { + return false + } + mouse_state.AddCellRegion(hyperlink_state.action, hyperlink_state.start_x, hyperlink_state.start_y, max(0, x-1), y, on_click...) hyperlink_state.action = `` return true }