diff options
Diffstat (limited to 'src/mouse.zig')
| -rw-r--r-- | src/mouse.zig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mouse.zig b/src/mouse.zig index 790dc9d1..beea68df 100644 --- a/src/mouse.zig +++ b/src/mouse.zig @@ -685,11 +685,12 @@ fn gestureRange(p: *Pardes, id: usize, text: []const u8, on_tag: bool, operand: const pane = p.panes[id] orelse return .{}; if (on_tag) { const tag = tagline.tagText(p, p.scratch.allocator(), pane) catch return .{}; + const shown = tagline.shownTag(p, p.scratch.allocator(), pane) catch return .{}; const sel = operand.expanded orelse operand.preview orelse return .{}; const lead = if (sel.r0 < sel.r1 or (sel.r0 == sel.r1 and sel.c0 <= sel.c1)) sel else Pane.Sel{ .r0 = sel.r1, .c0 = sel.c1 }; const row: usize = @as(usize, @intCast(@max(0, lead.r0))) + pane.tag_top; - const start = modal.lineStartOffset(tag, row); - const at = start + panes.File.rawAtDisplay(modal.lineSlice(tag, row), @intCast(@max(0, lead.c0))); + const start = modal.lineStartOffset(shown.text, row); + const at = shown.toReal(start + panes.File.rawAtDisplay(modal.lineSlice(shown.text, row), @intCast(@max(0, lead.c0)))); const q0: u32 = @intCast(@min(at, tag.len)); return .{ .q0 = q0, .q1 = @intCast(@min(q0 + text.len, tag.len)) }; } |
