summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 16:20:24 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit3992e9def8692710590deacbc20bd925e0f8d64a (patch)
treeab47f821d993903fedef10425eda547e26ae82b8 /docs
parent06fe2290db7d0eb654b9a908358942cfde298e29 (diff)
downloadpardes-3992e9def8692710590deacbc20bd925e0f8d64a.tar.gz
pardes-3992e9def8692710590deacbc20bd925e0f8d64a.zip
Q records keys into a register and q types them again; . repeats the last insert
Macro.zig keeps keys to be typed again. Q records into @ (or "<reg>) in helix's key notation until the next Q; q replays a register's keys count times through the modal handling, where Esc does not hop panes and Enter, Tab and Space neither look, execute nor open the leader. . replays the normal command that entered the last insert session once and what was typed in it count times (helix repeat_last_insert). a at the end of the text now adds the newline helix's append_mode does, which a terminal's text does not. helix-golf's invert_dictionary passes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'docs')
-rw-r--r--docs/helix-keys.md15
-rw-r--r--docs/selections.md5
2 files changed, 12 insertions, 8 deletions
diff --git a/docs/helix-keys.md b/docs/helix-keys.md
index cd33ccbe..3d02893b 100644
--- a/docs/helix-keys.md
+++ b/docs/helix-keys.md
@@ -80,8 +80,8 @@ at the bottom.
`gj` the textual one. With the toggle off a line is one visual row and the
two pairs are the same motion.
- **Undo is snapshot-per-edit-op / per-insert-session**, not a
- transaction log. Anything requiring replayable edits (`.`,
- macros) needs new machinery.
+ transaction log. `.` and macros replay KEYS (`Macro.zig`), not
+ edits, so they need none.
## A. Implemented today
@@ -147,6 +147,9 @@ language-backend queries, and the shell pipe.
| `!` | run with NO stdin, insert the output BEFORE each selection | helix `shell_insert_output`. Runs ONCE and every cursor gets that one answer, as helix does — ten cursors and `date` give ten identical stamps. Marker `!` | out of corpus |
| `A-!` | the same, appended AFTER each selection | helix `shell_append_output`. Marker `!+` | out of corpus |
| `$` | keep only the selections a shell command exits 0 on: each range's text on its stdin, one run per range, its output discarded; the primary stays if kept, else the last kept range takes over, and keeping none changes nothing | helix `shell_keep_pipe`. The runner's answer is all or nothing, so the command runs as `(cmd) >/dev/null; echo $?` and the status comes back as the output. Marker `$` | out of corpus |
+| `Q` / `"<reg>Q` | record the keys that follow into `@` (or the named register) until the next `Q`; kept as helix writes a macro, in key notation (`xt,S=<ret>_<A-(>`), so `"@p` pastes it and a yanked text can be replayed | helix `record_macro` | helix-verified |
+| `q` / `<n>q` / `"<reg>q` | type a register's keys again, n times. Replayed keys go to the modal handling only: Esc does not hop panes, Enter and Tab neither look nor execute, and Space does not open the leader | helix `replay_macro`; `Macro.zig`, `Pardes.replayKeys` | helix-verified |
+| `.` / `<n>.` | repeat the last insert session: the normal command that entered it once, the keys typed n times, then leave insert mode the way it was left | helix `repeat_last_insert`; the same key log as macros | helix-verified |
## B. To implement
@@ -352,7 +355,6 @@ text.
| `]f [f ]t [t ]a [a ]c [c ]e [e ]T [T ]x [x` | TS unimpaired jumps | tree-sitter |
| `]g [g ]G [G` | git change jumps | needs VCS diff state |
| insert `Ctrl-x` | completion menu | completion exists, but not as a popup: insert-mode Tab straight after a `.` opens a buffer of candidate DECLARATIONS (section A). helix's menu itself is skipped |
-| `Q` / `q` | record / replay macro | macros — needs replayable input log |
| `Ctrl-s` (normal) | save jumplist position | jumplist itself is implemented (`Ctrl-o`/`Ctrl-i`, section A); only the explicit save point is skipped |
| `Alt-u` / `Alt-U` | undo-history earlier/later | history timeline — linear snapshot u/U covers pardes |
| `K Alt-K`, `Alt-:` | regex keep/remove, ensure-forward | `K`/`Alt-K` are the same prompt `s`/`S` now have, filtering instead of splitting (`s S` moved to "Regex selection" in A, the rest of the family to "Multiple cursors") |
@@ -363,7 +365,6 @@ text.
| `Shift-Tab` (insert), smart-tab semantics | insert tab / smart tab | smart-tab machinery; plain Tab-inserts-tab lands in B |
| `Z` (sticky view mode) | persistent view mode | marginal; `z` one-shots suffice |
| `zm` (view) | align middle horizontally | marginal even with hscroll |
-| `.` | repeat last insert | **deferred by decision**: needs recording the insert session's keystrokes and a replay path — a new subsystem; undo is whole-buffer snapshots with no edit log to piggyback on. Revisit after phases 2–5 if the log exists by then for another reason |
| Select/extend mode section (prose) | `v` turns all motions into extenders, `n`/`N` keep selections | implemented for motions (phase 5: `pane.select` + the fixed anchor, differential-verified — see the `v` row in A); helix's search-`n`/`N` extension doesn't apply (pardes' `n`/`N` is the look-ring motion, which REPLACES the selection with the span it lands on) |
## Differential testing (phase 5)
@@ -403,13 +404,15 @@ Files (all in `test/hxcases/`):
registers of one value per range, `sel-regex-caret` and
`sel-regex-dot-newline` when `s`/`S` began searching line by line.
- `parity.jsonl` — 80 further cases, used only by the parity gate below.
-- `parity-waivers.jsonl` — 14 named exemptions for the parity gate, in three
+- `parity-waivers.jsonl` — 15 named exemptions for the parity gate, in three
classes: one deliberate pardes binding (`ctrl-b-page`, since `Ctrl-b` IS the
tty toggle), eight pty VIEWPORT divergences (a terminal's view cannot scroll
below the vt's live grid bottom, so the cursor snaps into a different
scrolloff band — no text differs), and five case texts a pty cannot hold
verbatim (a literal TAB the emulator expands, a file with no trailing
- newline, an all-whitespace last row the dump trims).
+ newline, an all-whitespace last row the dump trims). One more,
+ `dot-append-count`: `a` at a file's end grows it by a newline (helix
+ append_mode), which a terminal's text, not the editor's to grow, does not.
- `golf.jsonl` + `golf-goldens.jsonl` — every example on helix-golf
(github.com/nik-rev/helix-golf, imported at d78c18c): one case per numbered
step of each walkthrough, its keys being the command up to and including
diff --git a/docs/selections.md b/docs/selections.md
index 35fa806f..202ec3d9 100644
--- a/docs/selections.md
+++ b/docs/selections.md
@@ -98,8 +98,9 @@ the replay.
answer from the shell that comes later, so `"+p` pastes once, at the
primary, and insert `Ctrl-r +` types what pardes last put on the
clipboard rather than asking the desktop.
-- `Alt-.` repeats the last `f`/`t`/`F`/`T`. There is no `.` and there are no
- macros.
+- `Alt-.` repeats the last `f`/`t`/`F`/`T`. `.` and macros (`Q`/`q`) are
+ keys typed again (`Macro.zig`), so whatever those keys do to the ranges
+ happens again: there is no edit log underneath.
## Where it differs from helix