diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-03 16:10:37 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-09-03 16:10:37 -0300 |
| commit | 8435c7fe0113525f6df8420fa6fef45362bd65ab (patch) | |
| tree | 7f1cda3fb240a92bfcc8d234a733bc813c7f8b52 /src/web/libc | |
| parent | b2074ff6b2e822886cecfc81789e7fa504d05580 (diff) | |
| download | pardes-8435c7fe0113525f6df8420fa6fef45362bd65ab.tar.gz pardes-8435c7fe0113525f6df8420fa6fef45362bd65ab.zip | |
chords: Look and Exec act once per selection, and say when they cannot
Both acme chords read the PRIMARY range and dropped every other cursor on the
floor — the one thing a multi-cursor editor must not do with a command the user
aimed at all of them. They are also structurally outside the machinery that
would have handled it: the Enter/Tab chord is intercepted before `handleNormal`
so it never becomes an Action with a scope, and `runBuiltin` bails on
`multiOnce` anyway, because a builtin is per-keystroke rather than per-cursor.
So `chordEachSel` takes the `submitPipe` shape instead: `paneRanges` once,
forward in document order, every range's bytes COPIED before the first builtin
runs. The copy is not caution — a `Look` opens panes and an `Exec` can run a
builtin that edits or closes the pane those offsets point into, and a selection
whose text is `Del` is a legal Exec. The loop re-checks the slot and its serial
between iterations, the same guard `replaySels` makes for the same reason. With
one cursor it returns false on the first line and the old path runs untouched.
FOCUS FOLLOWS THE PRIMARY. `lookAt` sets `p.active` for every target it opens,
so `Look` over four selections used to leave you at whichever one happened to
sort last — an accident rather than an answer.
...AND A LOOK WITH NOWHERE TO PUT ITS ANSWER SAYS SO. All four slot checks in
`lookAt` were a bare `orelse return`: with one selection that merely felt like a
dead key, and with several it means "I opened nine of your fourteen and told you
nothing". They report `NoPaneSlots` now, through the channel output_pane.zig
already raises it on and a test already pins. The three openers report their own
failure too, so a file that will not open says whether it was permission, a
pipe, or size — which `look.readFile` only started distinguishing this week.
Known and left: N selections that all resolve to nothing run N searches over
one +Search buffer. Wasteful, converges, and worth its own change.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016Q4RATpafkwahrovHQLKRf
Diffstat (limited to 'src/web/libc')
0 files changed, 0 insertions, 0 deletions
