summaryrefslogtreecommitdiff
path: root/docs/typ
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-26 21:45:46 -0300
committerGabriel Schneider <[email protected]>2026-11-26 23:24:00 -0300
commit24dc19130fd6a063bb7e86fa21a02d7af4c3b163 (patch)
tree761d6a1b439f5ea31f3679c8b4f2874e0acfbeb7 /docs/typ
parent8d2a064eb69a1f888c435c3a0e03468b59abbb0d (diff)
downloadpardes-24dc19130fd6a063bb7e86fa21a02d7af4c3b163.tar.gz
pardes-24dc19130fd6a063bb7e86fa21a02d7af4c3b163.zip
Root, and the explicit root keys SPC f F, SPC f G and SPC :: Find, Grep and the `:` line run at the project's root, the nearest directory at or above the asking pane's holding a `.jj` or a `.git` (Pick.workTree, kept by zxsqtpol for this), the pane's own when none does, while SPC f f, SPC f g and `:` keep acme's directory (the user's ruling of 2026-11-26: "maybe some commands SHOULD run on the project root for convenience", explicit twins, nothing implicit); WHY A WORD: a leader leaf names a builtin (config.leader_path, leader_args) and `:` is a normal-mode role, so the three keys need one word that reaches the root: `Root <line>` runs the line as Exec does with the step's flag Pardes.exec_root set, bare (SPC :) it opens the `:` line marked to run there, and a script's `Root make` or `Root Grep x` falls out of it at a ctl for free; THE CHANGE: builtins.Root; Pardes.exec_root, a step's own (replica `.local`, root.zig's kept_out) like exec_column; execDir reads the root under it (a command pane's directory, Term's, and Query.create's, which now calls execDir in place of its copy of it); executeFrom sends Root's line to a command pane even from a shell at its prompt, and runCommand reuses only a finished command pane at the root for it (not the asking one); Pick.root: a picker Root asked lists from the root, its head `␣ f Find root`, `Grep root`, its list word `Find root …`, Exec on that word running at the root again, a Grep's leading directory read from the root (grepScope, unchanged); Command.root: SPC :'s line, its head `: root`, `= Root make` as its plain word, its Enter and its `:open ` run as Root; config: Root's leader path `:`, leader_args fF and fG run `Root Find` and `Root Grep`, which-key labels `Find root` and `Grep root` (bindings.zig); replica's may_wait gets back a kind row, `Root *` (the root's stat on the session's disk), walked as `Root Find` (walk_samples: bare Root, the `:` line, asks the disk nothing); docs: Root's own doc (the Help index row `SPC : Root`, builtins-tui.json from `zig build builtins-json`, the same line put in builtins-gui.json), the cheatsheet's leader list (three short rows), guide.typ's Find and Grep rows and its where-commands-run table; RUN (TEST FIRST): behaviour/find_grep.zig (the reference's Find and Grep chapter, new): a `.jj` project, `x.txt` two directories below it: SPC f f lists `x.txt` alone and no `Find root`, SPC f F `␣ f Find root` with `a/b/x.txt` and `top.txt` (`.jj` passed over); SPC f G `needle` `␣ f Grep root needle` with `a/b/x.txt:1 needle below` and `top.txt:1 … needle at the top`, `a needle` the first alone (a/ is the root's); look_and_exec.zig: `:pwd` makes a command pane named `<root>/a/b`, SPC : shows `: root` and its `pwd` a second command pane named `<root>` (a `.git` project), each body `% pwd`; the three fail on zxsqtpol 8d2a064eb69a (`not on the screen: ␣ f Find root`, `… ␣ f Grep root needle`, `… : root`), pass now; test/session.zig gains `advance`, the host's clock moved on, so a typed Grep's 80 ms pause comes due in a T1 test; REAL CHECK (a private detached session of this Debug build over 9P, CA's demo copied with a `.jj` at its top): from src/torque/types.cc SPC f f types.cc types.h, SPC f F `Find root` Makefile compile_commands.json src/torque/types.cc … 1/5, SPC f G ToString `Grep root` three hits from the root, `src ToString` narrowed, `:pwd` printed …/demo/src/torque, SPC : `: root`, `: root make = Root make`, its pwd printed …/demo, its make ran `clang++ … src/torque/types.cc` at the root (exit 2, the demo's error) and SPC e from types.cc walked to types.cc:7:11, `SPC :open Make` opened `Find root Make`; GOLDENS (process-test --update, read): leader.golden spc and unmapped (`: Root` after `/ All` in SPC's level), find.golden group (`F Find root`, `G Grep root` in SPC f's), nothing else moved; NO hot path (a stat per directory up to the root once per Root run; a flag and five bytes in the head); the dump and the digest gain two bools (Pick.root, Command.root): the 40,000-seed dump fuzz (40,000 + 40,000 join seeds, 1,779 image seeds) 11/11, core/fuzz.zig restored byte for byte; GATES: Debug core-test 1172/1349 (177 skipped), shell-test 1390/1393 (3 skipped; the walk with Root's row), addons 8/8, term-test 17/17, kitty-test 45/45, process-test 0 of 149 failed (3 skipped), pane-test 184/185, behaviour-test 293/293 and --replay 293/293 (+3), consumer-test, the soak twice (rtt 30/80/207: diverged 0, unequal 0, quiet checks 617/0 485/0 568/0 and 499/0 387/0 553/0, unlisted stops 0, the corpus 22 of 22 scenes the same, no leak), daemon.py plain x3, games, window-clients, clients x5, relink, launch, pair, gui, client-motion rc 0, far rc 1 (`no link of the far client ended under the flood`, as on the base), client-resize-real skipped (no compositor), the macOS x86_64 and arm64 and FreeBSD cross-builds; ReleaseSafe: the build (0 invalid options), the soak (diverged 0, unequal 0, quiet checks 514/0 381/0 543/0, unlisted stops 0), process-test 1 of 149 failed (root-ctl Restore, as on the base), upgrade from the installed ab9fa40a7bbb, upgrade-gui, upgrade-self (65 s) and upgrade-back (40 s) each nothing left behind, launch, clients x3, far, gui, client-motion, client-resize-real, client-idle, pair, plain x3 rc 0; load 1.2 to 3.6
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'docs/typ')
-rw-r--r--docs/typ/builtins-gui.json1
-rw-r--r--docs/typ/builtins-tui.json1
-rw-r--r--docs/typ/cheatsheet.typ3
-rw-r--r--docs/typ/guide.typ8
4 files changed, 10 insertions, 3 deletions
diff --git a/docs/typ/builtins-gui.json b/docs/typ/builtins-gui.json
index ee7375c8..d846c2b7 100644
--- a/docs/typ/builtins-gui.json
+++ b/docs/typ/builtins-gui.json
@@ -95,6 +95,7 @@
{"name": "Restore", "leader": "SPC s r", "also": [], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "Replace every pane with those of a dump.", "text": "Replace every pane with those of a dump.\n`Restore <label>`: the state file's dump of that label (History lists them); `Restore <file>`: a dump file's, a path, or the name of a file in the DumpDir or the directory pardes runs in. Bare: the last one this session made, else the newest. A file that is not a dump is said first; then, as Exit, it is refused once while a pane holds unsaved text."},
{"name": "Resume", "leader": "SPC '", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Reopen the last picker as it was: its rows, marks, cursor and query.", "text": "Reopen the last picker as it was: its rows, marks, cursor and query.\nUnder this pane's tag, previewing where its Enter lands: this pane if it reads, else its reader. `SPC '`; again after its Esc, nothing typed between, the one before it; Ctrl-o and Ctrl-i in it, the older and newer."},
{"name": "Right", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Move the keyboard to the pane, or column tag, to the right.", "text": "Move the keyboard to the pane, or column tag, to the right."},
+ {"name": "Root", "leader": "SPC :", "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Run its argument as Exec does, at the project's root.", "text": "Run its argument as Exec does, at the project's root.\nThe root is the nearest directory at or above this pane's holding a `.jj` or a `.git`, else this pane's own. `Root make` runs make there in a command pane; `Root Find` and `Root Grep` (`SPC f F`, `SPC f G`) search from there, their heads `Find root` and `Grep root`, a Grep's leading directory read from the root. Bare (`SPC :`), the `:` line, its head `: root`, whose Enter runs the line there."},
{"name": "Save", "leader": "SPC f s", "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Write the pane's text to its file, or to the file its argument names.", "text": "Write the pane's text to its file, or to the file its argument names.\n`Save <path>` writes it there. Bare, a pane with no file of its own (a +New, a list, a terminal) asks for a path; a file at a revision is read-only, written only to a path. Over a file changed on disk since it was read, it warns once."},
{"name": "Search", "leader": null, "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Search in a query pane under this pane, its line 1 the argument.", "text": "Search in a query pane under this pane, its line 1 the argument.\nLine 1's first word names what it searches: `/re` this pane's text, `Find`, `Grep`, `Recent`, `Panes`, `Symbols`, `All` (every open pane's text), `Refs`, `Def`, `Impl`, `Diagnostics`; a line with none of them is a `/`: `Search lay` is `/lay`. Bare, `/`, typed into. `SPC b b`, `SPC s s` and `SPC /` open it with Panes, Symbols and All."},
{"name": "SelectRefs", "leader": "SPC l h", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Select every reference to the symbol under the cursor.", "text": "Select every reference to the symbol under the cursor."},
diff --git a/docs/typ/builtins-tui.json b/docs/typ/builtins-tui.json
index 99e46ac7..57ac63f3 100644
--- a/docs/typ/builtins-tui.json
+++ b/docs/typ/builtins-tui.json
@@ -90,6 +90,7 @@
{"name": "Restore", "leader": "SPC s r", "also": [], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "Replace every pane with those of a dump.", "text": "Replace every pane with those of a dump.\n`Restore <label>`: the state file's dump of that label (History lists them); `Restore <file>`: a dump file's, a path, or the name of a file in the DumpDir or the directory pardes runs in. Bare: the last one this session made, else the newest. A file that is not a dump is said first; then, as Exit, it is refused once while a pane holds unsaved text."},
{"name": "Resume", "leader": "SPC '", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Reopen the last picker as it was: its rows, marks, cursor and query.", "text": "Reopen the last picker as it was: its rows, marks, cursor and query.\nUnder this pane's tag, previewing where its Enter lands: this pane if it reads, else its reader. `SPC '`; again after its Esc, nothing typed between, the one before it; Ctrl-o and Ctrl-i in it, the older and newer."},
{"name": "Right", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Move the keyboard to the pane, or column tag, to the right.", "text": "Move the keyboard to the pane, or column tag, to the right."},
+ {"name": "Root", "leader": "SPC :", "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Run its argument as Exec does, at the project's root.", "text": "Run its argument as Exec does, at the project's root.\nThe root is the nearest directory at or above this pane's holding a `.jj` or a `.git`, else this pane's own. `Root make` runs make there in a command pane; `Root Find` and `Root Grep` (`SPC f F`, `SPC f G`) search from there, their heads `Find root` and `Grep root`, a Grep's leading directory read from the root. Bare (`SPC :`), the `:` line, its head `: root`, whose Enter runs the line there."},
{"name": "Save", "leader": "SPC f s", "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Write the pane's text to its file, or to the file its argument names.", "text": "Write the pane's text to its file, or to the file its argument names.\n`Save <path>` writes it there. Bare, a pane with no file of its own (a +New, a list, a terminal) asks for a path; a file at a revision is read-only, written only to a path. Over a file changed on disk since it was read, it warns once."},
{"name": "Search", "leader": null, "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Search in a query pane under this pane, its line 1 the argument.", "text": "Search in a query pane under this pane, its line 1 the argument.\nLine 1's first word names what it searches: `/re` this pane's text, `Find`, `Grep`, `Recent`, `Panes`, `Symbols`, `All` (every open pane's text), `Refs`, `Def`, `Impl`, `Diagnostics`; a line with none of them is a `/`: `Search lay` is `/lay`. Bare, `/`, typed into. `SPC b b`, `SPC s s` and `SPC /` open it with Panes, Symbols and All."},
{"name": "SelectRefs", "leader": "SPC l h", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Select every reference to the symbol under the cursor.", "text": "Select every reference to the symbol under the cursor."},
diff --git a/docs/typ/cheatsheet.typ b/docs/typ/cheatsheet.typ
index 2307db2c..dfc9f71c 100644
--- a/docs/typ/cheatsheet.typ
+++ b/docs/typ/cheatsheet.typ
@@ -88,6 +88,9 @@ Helix-style: motions *select*, then an edit acts on the selection. Mode box: bla
key("SPC f n"), word("New"),
key("SPC f f"), word("Find"),
key("SPC f g"), word("Grep"),
+ key("SPC f F"), [#word("Find") at the root],
+ key("SPC f G"), [#word("Grep") at the root],
+ key("SPC :"), [`:` at the root],
key("SPC f r"), word("Recent"),
key("SPC f h"), word("History"),
key("SPC f l"), [#word("Lists"): the kept pickers],
diff --git a/docs/typ/guide.typ b/docs/typ/guide.typ
index 6d14c97c..df78852b 100644
--- a/docs/typ/guide.typ
+++ b/docs/typ/guide.typ
@@ -135,10 +135,12 @@ Where it runs depends on where you clicked:
[any other pane's text or tag], [a command pane in that pane's directory, in the last column],
[a column's tag], [a command pane in the session's directory, in that column],
[the workspace tag], [a command pane in the session's directory, in the last column],
+ [#key("SPC :") (#word("Root"))], [a command pane at the project's root: the nearest directory at or above the pane's holding a `.jj` or `.git`],
)
A file's text and tag run in its directory: `make` from `README` at the
-project root is right, from `src/main.c` it is not. The keyboard stays
+project root is right, from `src/main.c` it is not; #key("SPC :") `make`
+runs it at the root from anywhere in the project. The keyboard stays
where it was. The command pane's tag ends in `running`, then `exit N`:
#tag("Del", path: "/home/me/src (make) exit 0")
@@ -208,8 +210,8 @@ Line 1's first word names what it searches, and editing the word changes it:
#pairs(
[`/pat`], [the pane's own text: a regex, any case unless it has a capital (#key("/"))],
- [`Find name`], [the files below the pane's directory, by a fuzzy match of their names (#key("SPC f f"), #word("Find"))],
- [`Grep text`], [the lines of those files holding `text`, literally (#key("SPC f g"), #word("Grep")); past 2000 lines #word("More") goes on],
+ [`Find name`], [the files below the pane's directory, by a fuzzy match of their names (#key("SPC f f"), #word("Find")); #key("SPC f F") from the project's root, the nearest directory above holding a `.jj` or `.git`],
+ [`Grep text`], [the lines of those files holding `text`, literally (#key("SPC f g"), #word("Grep"); #key("SPC f G") from the project's root); past 2000 lines #word("More") goes on],
[`Recent name`], [the files opened lately, in any window (#key("SPC f r"), #word("Recent"))],
[`Panes name`], [the open panes, then the ones closed this session, `(closed)` and dimmer: #key("Enter") (or a #word("Look") at its `@pN`) brings one back where it was, its text with it (#key("SPC b b"), #word("Panes"))],
[`Symbols name`], [the text's symbols, a row each: its kind's mark (`t` type, `f` function, `m` field, `c` const, `v` var, `n` module, `·` other), its name in the ones it is in (`Counts.lines`), what its line says after the name; types, functions, fields, then the rest, each in the text's order, and so while typed, the best match current (#key("SPC s s"))],