summaryrefslogtreecommitdiff
path: root/core/mouse.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-24 19:24:44 -0300
committerGabriel Schneider <[email protected]>2026-11-24 19:24:44 -0300
commit1c4aea3b0298f6f59ffec9b49f4d5e5f38c8af0f (patch)
tree09aa46200e9b005852a533da932c46b09a077388 /core/mouse.zig
parent08524143c84c069a80861895fafd0b7411a201f5 (diff)
downloadpardes-1c4aea3b0298f6f59ffec9b49f4d5e5f38c8af0f.tar.gz
pardes-1c4aea3b0298f6f59ffec9b49f4d5e5f38c8af0f.zip
walk (pick-ui SPEC §6.3, §6.4, item 3 of the Walk UI line B): a reader's trail is words of its tag: its back steps before its path (`‹@p3 › rank.zig:14 › `, the owner's word written so that its Look is `@p3`, the newest shown_steps 3 whole and older ones folded to `·`, still their steps), its forward steps after it, dimmed in the theme's lineno ink (draw.zig inkTag, the name's tint loop made one with it), then Keep; the prefix is made in the room Trail.bytes measures (tagline.pathPrefix, no allocation past it), and the name's place after the words is tagline.nameAt (onName, typedIntoName, tagTintRange, the drafted name's caret); a click on a step's word is that step's Look (B1 with no drag, the one place it does more than select, and B3) or Exec (B2): a place gone back to (the later steps kept as forward steps) or forward to, the owner focused; a list, a search or a recipe word says it is not walked yet (their makers are D's and E's: Trail.lookStep, Trail.execStep); TEST FIRST: Trail.zig "the session of pick-ui §6.7: four jumps across three files, back by a click on a trail word, the later steps kept dimmed after the path, forward again, Keep, and a new reader on the next jump" and "a trail keeps its newest three back steps whole, older ones fold to ·, and a click on a · goes back to its step"; core-test 998/1164 (166 skipped), pane-test 183/184, behaviour-test 277/277
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'core/mouse.zig')
-rw-r--r--core/mouse.zig16
1 files changed, 14 insertions, 2 deletions
diff --git a/core/mouse.zig b/core/mouse.zig
index 14700995..1356ace4 100644
--- a/core/mouse.zig
+++ b/core/mouse.zig
@@ -1211,8 +1211,12 @@ fn dragRelease(p: *Pardes, button: Mouse.Button) void {
// click on the path, if it can be renamed, drafts a name.
const row: usize = @intCast(@max(0, sl.r1));
const col: usize = @intCast(@max(0, sl.c1));
- if (!dragged and tagline.onName(p.settings.tab, pane, row, col)) {
- tagline.draftName(p, pane, col);
+ // A plain click on a word of its walk is its Look
+ // (pick-ui SPEC §6.3): the one place B1 does more than
+ // select.
+ if (!dragged and tagline.trailClick(p, s.id, row, col, false)) return;
+ if (if (dragged) null else tagline.onName(p.settings.tab, pane, row, col)) |at| {
+ tagline.draftName(p, pane, at);
} else if (tagline.tagOffsetAt(p, pane, row, col)) |cursor| {
pane.tag.cur_row = @intCast(cursor.row);
pane.tag.cur_col = @intCast(cursor.col);
@@ -1278,6 +1282,14 @@ fn dragRelease(p: *Pardes, button: Mouse.Button) void {
return;
}
};
+ // On a word of the tag's walk: that step's Look or Exec
+ // (Trail.zig), not the word's.
+ if (clk.r0 >= 0 and clk.r0 < pane.tag_rows and clk.r0 == clk.r1 and clk.c0 == clk.c1 and clk.c0 >= 0 and
+ tagline.trailClick(p, s.id, @intCast(clk.r0), @intCast(clk.c0), s.button == config.exec_button))
+ {
+ pane.sel[b].state = .none;
+ return;
+ }
var operand = exec.operandAt(p, pane, clk, true, s.button == config.look_button);
if (operand.expanded) |expanded|
pane.sel[b] = expanded