diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 13:09:12 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:14 -0300 |
| commit | 84fca2d6e5f498f2d4384712d49d727a25441d68 (patch) | |
| tree | 47a6d01ee65c5d631f59bee2f1efc5685ceb95f4 /src/mouse.zig | |
| parent | 047a2b50a7ac0162d7ef38f912d41c15a47479c7 (diff) | |
| download | pardes-84fca2d6e5f498f2d4384712d49d727a25441d68.tar.gz pardes-84fca2d6e5f498f2d4384712d49d727a25441d68.zip | |
A click that takes no text tells the event reader nothing, and click records are tested for their offsets
Dogfooding saw a body right-click reported as ML0 0 2 3 qty. On file panes
the offsets were right in every case tried here (a scratch made over 9P and
clicked while another pane is active, after a hover, scrolled, soft-wrapped,
tab-indented, inside parentheses); the test now holds them. The 0 0 form
is a terminal's body, which has no offsets to give (its body is a history
snapshot); since the event file now takes a record back whole, such a record
can still be written back and done, and the docs say so. What the test did
find: a click on whitespace sent an empty record, where acme's look3 and
execute return without a word on an empty expansion (look.c:37, exec.c:141).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/mouse.zig')
| -rw-r--r-- | src/mouse.zig | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mouse.zig b/src/mouse.zig index beb2e624..0ec20df2 100644 --- a/src/mouse.zig +++ b/src/mouse.zig @@ -715,10 +715,9 @@ fn dispatchPointerBuiltin( const arg = p.chord_arg; p.chord_arg = null; defer if (arg) |a| p.gpa.free(a); - const operand = text orelse { - if (gesture) |g| _ = reportGesture(p, id, cmd, "", g.on_tag, g.operand, arg != null); - return; - }; + // A click that takes no text does nothing, and tells an event reader + // nothing, as acme's look3 and execute return on an empty expansion. + const operand = text orelse return; if (gesture) |g| if (reportGesture(p, id, cmd, operand, g.on_tag, g.operand, arg != null)) return; exec.runBuiltin(p, cmd, id, "", exec.withArg(p, operand, arg)); } |
