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/builtins.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/builtins.zig') diff --git a/src/builtins.zig b/src/builtins.zig index cca7bfb5..1a2f132f 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -516,7 +516,10 @@ pub const Look = struct { // name on the message row would only be noise over that pub const quiet = true; pub fn run(c: Ctx) void { - look.lookAt(c.p, c.id, c.arg orelse return); + // Bare (a key bound to it, a tag's Look with nothing held): the + // selection, else what Enter on the cursor takes, the one expansion. + const arg = c.arg orelse (exec.currentOperand(c.p, c.pane) orelse return); + look.lookAt(c.p, c.id, arg); } }; -- cgit v1.3