From a9529fa5712298e9005b77b471400529a2ebbc32 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 03:35:02 -0300 Subject: hxdiff: a case may name its file pane ("path", whose extension picks the grammar), and test/hxcases/indent.jsonl pins the new line's indent in a Zig, a Python, a Rust and a plain-text file against the reference helix with its grammars, typed into a real hx in a pty by hx_indent.py since the harness runs without any; zig build hxdiff runs it before the suite Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- docs/helix-keys.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/helix-keys.md b/docs/helix-keys.md index f7a3093d..86c50722 100644 --- a/docs/helix-keys.md +++ b/docs/helix-keys.md @@ -117,7 +117,7 @@ language-backend queries, and the shell pipe. | `zm` | scroll the unwrapped view so the cursor's column is in its middle | helix `align_view_middle`; with soft wrap on there is no horizontal scroll, and nothing happens | out of corpus (the harness's text never scrolls sideways) | | `i` `a` | insert at selection start / after selection end | helix semantics: `i` before the selection, `a` selects and appends after it | helix-verified | | `I` `A` | insert at first non-ws / line end | matches `insert_at_line_start` / `insert_at_line_end` | helix-verified | -| `o` `O` | open line below / above, with the current line's indent as it is (acme's autoindent, tabs and all); `o` opens n | `open_below`/`open_above`, except that helix's no-language fallback rounds the indent down to whole units: under its 4-space unit, two spaces open a line with none (waiver `o-partial-indent-drops`) | helix-verified (whole units) / pardes-specific (partial) | +| `o` `O` | open line below / above, with helix's indent from the syntax tree where the file's grammar has an indent query (src/indent.zig, as Enter), else the current line's indent as it is (acme's autoindent, tabs and all); `o` opens n | `open_below`/`open_above`, except that helix's no-language fallback rounds the indent down to whole units: under its 4-space unit, two spaces open a line with none (waiver `o-partial-indent-drops`) | helix-verified (whole units) / pardes-specific (partial) | | `v` | select (extend) mode: motions extend from the fixed anchor; `v` again exits KEEPING the selection | mode "select" is reported only while this is on (helix keeps mode normal for x/%/mi selections) | helix-verified | | `x` / `x` | select current line / extend one (n) line(s) down, char-range through the newline, cursor ON the `\n` | col-0 vim-ism removed (phase 5); matches `extend_line_below`, mode stays normal | helix-verified | | `d` | delete selection (implicit or explicit); bare cursor = the 1-wide selection | always yanks (`Alt-d` noyank in B); terminals: drops typed runs only | helix-verified | @@ -141,7 +141,7 @@ language-backend queries, and the shell pipe. | `n` / `N` | next / previous match of the text's places when a query pane fed them (a `/`, a list's places in this text: refs, diagnostics, a Grep's hits), round the ends without a message; else the last search register's regex in the current text, as before; counts repeat | only the primary selection is replaced; in select mode each match is added and becomes primary. Named registers work. `*` sets the pattern from selections with word boundaries (`Alt-*` without) and seeds the text's query pane with it, the keyboard staying. The former Look ring is `LookNext` / `LookPrev`, `SPC j n` / `SPC j p`. PDFs retain their location-result navigation | helix-verified | | insert: printable text | file: real edit; terminal: typed run splice | | helix-verified (file) | -| insert: `Enter` | newline; keeps the current line's indent as it is and adds one 4-space logical tab (a tab where the indent is tabs) when the text before the cursor ends in `(`, `[`, `{`, or `)` (including `})`) | plain lines match `insert_newline` at whole indent units (helix drops a partial one, as for `o`); delimiter heuristic is pardes-specific | helix-verified (plain) / pardes-specific (partial indent, delimiter) | +| insert: `Enter` | newline; where the file's grammar has an indent query (vendor/queries/*/indents.scm), helix's `indent_for_newline` over the syntax tree (src/indent.zig, the reference's containment engine, `hybrid` heuristic); else keeps the current line's indent as it is and adds one 4-space logical tab (a tab where the indent is tabs) when the text before the cursor ends in `(`, `[`, `{`, or `)` (including `})`). Between a pair (helix's default auto-pairs) the closer gets a line of its own at that indent and the cursor one a level in (`insert_newline`'s `on_auto_pair`) | plain lines match `insert_newline` at whole indent units (helix drops a partial one, as for `o`); delimiter heuristic is pardes-specific; with a grammar, `test/hxcases/indent.jsonl` against the reference `hx` and its grammars (`hx_indent.py`) | helix-verified (plain, grammar) / pardes-specific (partial indent, delimiter) | | insert: `Backspace` (+ `Shift-Backspace`) | delete prev char, joins lines at col 0; in a line's leading blanks, back to the previous 4-column indent stop (a whole unit when on one; a tab still goes alone) | matches `delete_char_backward` and its dedent; `Ctrl-h` alias in B | helix-verified | | insert: `Up` `Down` `Left` `Right` | move cursor | matches helix's "not recommended" insert arrows | helix-verified | | `gd` `gD` `gy` `gi` `gr` | LSP definition / declaration / type-definition / implementation / references. One answer jumps straight there; several (definition, implementation, references) fill the text's query pane, line 1 `Def`/`Impl`/`Refs`, their places in the text tinted and stepped by `n`/`N`; the others fill `+Search`, where `LookNext` / `LookPrev` walk and Enter opens | Ctrl+left-click is the mouse spelling of `gd`; language support depends on the configured backend | out of corpus | @@ -443,6 +443,17 @@ Files (all in `test/hxcases/`): harness and absent in pardes) to close its `VALUES (`, and `invert_dictionary_2` needs 25.07.1's `Alt-(` (rotate within groups of count) where the reference helix rotates by count. +- `indent.jsonl` + `indent-goldens.jsonl` — the new line's indent in a Zig, + a Python, a Rust and a plain-text file (each case's `path` names its file + pane): Enter after an opener, inside a block, before a closer and between + a pair, `o` and `O`. Their goldens are not the harness's, which runs + without grammars: `test/hxcases/hx_indent.py` types each case into a real + `hx` in a pty, the reference build (`cargo build --release --bin hx` at + the harness commit) with `HELIX_RUNTIME` the checkout's `runtime/`. + `zig build hxdiff` runs them first, their count a line before the suite's. + hx 25.07.1 agrees but on `py-ret-after-last-line`: its engine (before + upstream 3013c107d) keeps a function's level after its last line, the + reference's ends it there. - `smoke.jsonl` — 20 cases referenced by nothing in the tree: no build step, no script. Either wire it up or delete it. -- cgit v1.3