diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-24 20:33:44 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-24 20:33:44 -0300 |
| commit | 441e61294268bd0bb94abfa6b1ebb4ced23e726c (patch) | |
| tree | ddea5d6685ea34b474f734e33146a6c01dbf0920 /core/mouse.zig | |
| parent | 93160a4d7c6151fba394fd5ab51dea3b7468b937 (diff) | |
| download | pardes-441e61294268bd0bb94abfa6b1ebb4ced23e726c.tar.gz pardes-441e61294268bd0bb94abfa6b1ebb4ced23e726c.zip | |
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
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'core/mouse.zig')
| -rw-r--r-- | core/mouse.zig | 12 |
1 files changed, 12 insertions, 0 deletions
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); } |
