From 1a33ed7221733b181726c7ad01e4ce190bcf1d05 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 17:25:24 -0300 Subject: One Look path: Enter, Tab and a bare Look take what a click at the cursor takes, a diff line's address included, and an event reader is told of them as of a click The keyboard expanded the cursor's word on its own (look.expandedSel), so a diff line's address (and a hunk line's code word, without its +/-) was the mouse's alone: Enter on `+line` looked for the text in the diff. Now exec.operandAt is the one expansion: pointerOperand is it with a gesture's selection borrowed, the Enter/Tab path and a bare Look (exec.currentOperand) are it from the cursor, and both dispatch through mouse.dispatchPointerBuiltin, so a pane with an event reader hears a key's look or exec as a click's. A test runs one diff line and one file:12:5: line through a B3 click, a B3 sweep, Enter, a bare Look, the look file and an event write-back, and asserts each lands in the same file, line and column. Co-Authored-By: Claude Opus 5.5 --- src/mouse.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mouse.zig') diff --git a/src/mouse.zig b/src/mouse.zig index 21961cf8..7a2d0805 100644 --- a/src/mouse.zig +++ b/src/mouse.zig @@ -1044,7 +1044,9 @@ fn gestureRange(p: *Pardes, id: usize, text: []const u8, on_tag: bool, operand: return .{ .q0 = q0, .q1 = @intCast(@min(q0 + text.len, f.content.len)) }; } -fn dispatchPointerBuiltin( +/// A look or exec of what an operand took (exec.operandAt), from a +/// click or a key: an event reader is told, else it runs. +pub fn dispatchPointerBuiltin( p: *Pardes, id: usize, cmd: Builtin, -- cgit v1.3