summaryrefslogtreecommitdiff
path: root/core/mouse.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-24 19:37:15 -0300
committerGabriel Schneider <[email protected]>2026-11-24 19:38:18 -0300
commit480f36b85299fa7407c20a2d6482dd093f842bf7 (patch)
tree5d07c37c3e4eae82ec35ed100799d5810a8912aa /core/mouse.zig
parentf44d1b7d040acf674814be3cde336527833450e9 (diff)
parent9f63733156853c925c31a948b50d4a3a7b77aa70 (diff)
downloadpardes-480f36b85299fa7407c20a2d6482dd093f842bf7.tar.gz
pardes-480f36b85299fa7407c20a2d6482dd093f842bf7.zip
walk UI wave-2 base: line A items 1-4 (kquzozvs) merged with line B items 1-5 (mqmtqvtt)
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 7a918883..f97bc39b 100644
--- a/core/mouse.zig
+++ b/core/mouse.zig
@@ -1249,8 +1249,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);
@@ -1316,6 +1320,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