diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/helix-keys.md | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/docs/helix-keys.md b/docs/helix-keys.md index 6c05e3ce..8cfd53ad 100644 --- a/docs/helix-keys.md +++ b/docs/helix-keys.md @@ -21,14 +21,17 @@ which the harness runs without. Code map, by SYMBOL — line numbers rot, names do not. Body-normal key RECOGNITION is `modal.Normal` in `src/modal.zig`: a state machine over `Role` (one -per bound command, matched against `src/config.zig`'s chord lists by -`normalInput` in `src/normal.zig`), a `Prefix`, a `MatchSub` and a count, emitting a -semantic `Action` that both the text and PDF adapters consume. It knows -nothing about panes or text. Then it is EXECUTED: `Key` and `handleKey` in -`src/pardes.zig` (intercept order is load-bearing, see the comment there); -`handleNormal` (parses directly into `Pane.normal`), `executeNormalAction`, -`replaySels` and `multiOnce` in `src/normal.zig`; `setPaneRange` (helix range -→ pane state); and `enterInsert`, `handleInsert` / `insertKey`, `insertTab`, +per bound command, named as `src/config.zig` binds it and matched against its +chord lists by `normalInput` in `src/normal.zig`), the pending prefix and `m` +sub-key (each the role of the key read) and a count, emitting an `Action`: the +role and what it was given (a count, a literal, `]` or `[`). The roles are +grouped by the context a key is read in and tried in their order there. The +text's executor (`executeNormalAction`) and a PDF's (`pdf_view.applyNormal`) +both switch on the role. It knows nothing about panes or text. Then it is +EXECUTED: `Key` and `handleKey` in `src/pardes.zig` (intercept order is +load-bearing, see the comment there); `handleNormal` (parses directly into +`Pane.normal`), `executeNormalAction`, `replaySels` and `multiOnce` in +`src/normal.zig`; and `enterInsert`, `handleInsert` / `insertKey`, `insertTab`, `normalDelete`, `normalYank`, `pasteText`, `normalChange` in `src/edit.zig`. Undo and redo live in `panes.File` and `panes.Terminal`. Pure text math: `src/modal.zig` (the `hx*` family is the helix-semantics layer: gap offsets + @@ -161,11 +164,11 @@ against keymap.md. Edit ops on terminal panes obey the immutable-output rule (typed runs only) — same as `d`/`c` today. `Pane.normal` holds `modal.Normal.State`: a count (accumulator, -capped 0xffff), a `Prefix` (`g` `z` `m` `f` `F` `t` `T` `r` `]` `[`), a -`MatchSub` (m-mode's `i`/`a`/`s`/`r`/`d`) and one `held_char` for `mr`'s +capped 0xffff), the prefix key's role (`g` `z` `m` `f` `F` `t` `T` `r` `]` `[` +`"`), the `m` sub-key's (`i`/`a`/`s`/`r`/`d`) and one `held_char` for `mr`'s `<from>`. `find_op`/`find_ch` (the `Alt-.` repeat target) stay -on `Pane`, because the parser emits `repeat_find` without remembering what was -found. Pure text math in `modal.zig`: `findChar`, `matchBracket`, +on the body's `Text`, because the parser emits `repeat_find` without remembering what was +found. Pure text math in `modal.zig`: `findTarget`, `matchBracket`, `paragraphFwd`/`paragraphBwd`/`paragraphRange`, textobject/surround ranges, `replaceRange`/`replaceChars`, `changeCase`, `joinLine`, `indentLines`, `adjustNumber`, `deleteSpan`, `advanceBy` — each with inline tests that |
