From 441e61294268bd0bb94abfa6b1ebb4ced23e726c Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 24 Nov 2026 20:33:44 -0300 Subject: Pick: the act step (walk UI, pick-ui SPEC.md ยง5.5, item 3 of line D): M-l or M-Enter unrolls the acts beside the rows, headed by what they act on (`on 2 marked`, `on core/pick.zig`), and the head's second row says them before the sources' words (`Walk Look Split Newcol Grep Edit Copy Keep Drop | Grep Recent ...`); a key letter or Enter on the act's row: w Walk lands on the first picked place and queues the others (Pick.queue, the places as paths and spots), which Ctrl-i steps in the landing pane past its newest step (Pick.stepQueue, at the hook B left in Jump.jumpBy), o Look, s Split, v Newcol (Enter's three ways), g Grep a Grep picker in the picked rows' directory with the same pattern, e Edit the field a sam command (the head `Find pick | Edit s/a/b/`) run by Enter on each picked row's line in the open text that shows it (edit_cmd.run, from the last line up, a row whose file no pane shows passed over and said), y Copy the places as `path:line` lines into the unnamed register, k Keep as C-q, x Drop the picked rows as a refinement without them, d Del (the Panes list's, whose acts are Look Copy Keep Drop Del: its rows are no places) closes the picked panes and lists them again; an act's or a source's word run while the picker is live (B2 on the head's second row or on the band) is the picker's (Pick.execWord, at the head of exec.zig executeBuiltinLine; Grep, both, is the source); B3 on a picker's row lands on it and B2 runs the word with the picker live (mouse.zig bandPress: the picker's arm before A's toRest); a landing pane previewed in its own file has its caret and top put back when the picker rolls up (said in item 2's description, made here); TEST FIRST: Pick.zig "M-l unrolls the act step, which says what it acts on; Copy puts the places in the register, Drop takes the picked rows out, Walk queues the rest for C-i"; core-test 1017/1183 (166 skipped), 0 failed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- core/mouse.zig | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'core/mouse.zig') diff --git a/core/mouse.zig b/core/mouse.zig index f97bc39b..400d020b 100644 --- a/core/mouse.zig +++ b/core/mouse.zig @@ -905,6 +905,18 @@ fn bandPress(p: *Pardes, button: Mouse.Button, point: BandPoint) void { if (button != config.exec_button and button != config.look_button) return; const word = (pardes.Band.wordAt(p, arena, point.id, point.line, point.col) catch return) orelse return; const kept = arena.dupe(u8, word) catch return; + // A picker's band: B2 runs the word with the picker live (an act's word + // acts, Pick.execWord); B3 on a row lands on it. + if (v.tag_state.kind == .pick) { + if (button == config.exec_button) return exec.runBuiltin(p, config.exec_cmd, v.active, "", kept); + const band = (pardes.Band.of(p, arena, p.panes[point.id].?, point.id) catch return) orelse return; + const ln = band.line(arena, p.settings.tab, point.line) catch return; + for (ln.parts) |part| if (point.col >= part.col and point.col < part.col + part.width) { + pardes.TagState.point(p, part.row.index); + return pardes.Pick.landHere(p); + }; + return; + } pardes.TagState.toRest(p); exec.runBuiltin(p, if (button == config.exec_button) config.exec_cmd else config.look_cmd, v.active, "", kept); } -- cgit v1.3