summaryrefslogtreecommitdiff
path: root/core/mouse.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-24 22:55:09 -0300
committerGabriel Schneider <[email protected]>2026-11-24 22:58:47 -0300
commit226d8a7635959644a2bafc3d621648c7a5aca2ad (patch)
tree32bcf7eb3854763ab42c4a666f20b04fcdb8db6e /core/mouse.zig
parent7018de2abcf585e26024952cc0b4c97d25b3dc27 (diff)
parentd266ff2b816163ec9d09ec7ab79955b8fce719b0 (diff)
downloadpardes-226d8a7635959644a2bafc3d621648c7a5aca2ad.tar.gz
pardes-226d8a7635959644a2bafc3d621648c7a5aca2ad.zip
walk UI M2: A2's final tip rqntnxpr merged in (ztzvvwkk: B's ozlumvqo dump.zig hunks, already here, and the fuzz session in Help; rqntnxpr: a click that gives the keyboard to another pane ends a level as Esc does): core/fuzz.zig's one conflict is both sessions' setup kept, B's reader walk and then A2's tag out of rest; tui core-test 1034/1203 (169 skipped, 0 failed)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'core/mouse.zig')
-rw-r--r--core/mouse.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/mouse.zig b/core/mouse.zig
index b6e99300..feb5ac08 100644
--- a/core/mouse.zig
+++ b/core/mouse.zig
@@ -499,6 +499,17 @@ fn chordCutPaste(p: *Pardes, cut: bool) edit.Error!void {
pub fn handleMouse(p: *Pardes, event: Mouse) void {
const v = p.view();
+ // A click that gives the keyboard to another pane ends the level or
+ // typing state of the tag out of rest as Esc does, its text's prefix
+ // with it (SPEC ยง3.4.6: only the pane with the keyboard leaves rest);
+ // one in its band or its own tag keeps it.
+ const host = pardes.TagState.hostOf(p);
+ defer if (host) |was| if (v.active != was) {
+ const to = v.active;
+ v.active = was;
+ pardes.TagState.toRest(p);
+ v.active = to;
+ };
var m = event;
// A click goes somewhere else: the question it leaves unanswered is
// taken back, and the pane stays. A wheel only looks around.