diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-24 19:35:56 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-24 19:37:58 -0300 |
| commit | 173b0b8a4c854715e8bb697efc5c066927b7b671 (patch) | |
| tree | 3318589923205da6c7099f9bc4a92bee1f6ddd04 /core/builtins.zig | |
| parent | f44d1b7d040acf674814be3cde336527833450e9 (diff) | |
| download | pardes-173b0b8a4c854715e8bb697efc5c066927b7b671.tar.gz pardes-173b0b8a4c854715e8bb697efc5c066927b7b671.zip | |
TagState, builtins: describe-key (walk UI, pick-ui SPEC.md §4.5, item 5 of line A): SPC h k runs a new builtin, Keys (its word anywhere does the same), and the next keys typed are replayed in the tag of the pane it ran in (TagState.kind describe, its sequence in the view's scope_root and scope): the head says ` Keys` and the keys as key cells; a sequence that reaches a leaf shows ` Keys g ▸ d Def` and unrolls its level in the band with the leaf on the cursor and its doc beside it, for every root (g d, ] f, SPC l r, C-w h); Enter runs it, typed as its keys; a sequence nothing is bound to is struck, `runs nothing` (a first key that is no root's, `starts no sequence`); Backspace takes a key back, Esc goes to rest, any key after a sequence ended starts the next; docs/typ/builtins-tui.json and -gui.json have Keys (the tui's made by `zig build builtins-json`, the gui's line the same); TESTS: TagState.zig's describe-key (g d replayed with its level and doc in the band, ] f, SPC l r, g q struck, g e run by Enter) and window mode's level (C-w: its cell at once, its level after the delay, kept while h j k l move the outline, gone at Enter); core-test 1005 pass, 166 skip, 0 fail
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'core/builtins.zig')
| -rw-r--r-- | core/builtins.zig | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/builtins.zig b/core/builtins.zig index a236b0d6..718a0f1f 100644 --- a/core/builtins.zig +++ b/core/builtins.zig @@ -1622,6 +1622,19 @@ pub const Help = struct { } }; +/// Show what a key sequence runs: the next keys typed are replayed in the tag. +/// +/// The tag shows `Keys` and the keys as they are typed; a sequence that +/// reaches a leaf unrolls its level under the tag with the leaf on the +/// cursor and its documentation beside it, and Enter runs it. Every root +/// answers: SPC, g, m, z, Z, [, ], window mode's C-w. A sequence nothing +/// is bound to is shown struck, `runs nothing`. Esc leaves it. +pub const Keys = struct { + pub fn run(c: Ctx) void { + pardes.TagState.openDescribe(c.p, c.id); + } +}; + /// Open the startup file, `init` in the configuration directory, in a pane. /// /// Its pane when it is open, else the file; not there yet, a pane of that |
