summaryrefslogtreecommitdiff
path: root/core/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-23 15:59:04 -0300
committerGabriel Schneider <[email protected]>2026-11-23 16:00:06 -0300
commit5a62039f3e91f62e45bb0e969a3b76568d4f92ff (patch)
treec829c591a022fef303c67a1e142faa467efa58ad /core/builtins.zig
parent4f685df6994977843b82dd09572fed6c744b35d0 (diff)
downloadpardes-5a62039f3e91f62e45bb0e969a3b76568d4f92ff.tar.gz
pardes-5a62039f3e91f62e45bb0e969a3b76568d4f92ff.zip
help: the words of looking and finding documented for a user (item 5's second group: `Look`, `Exec`, `Find`, `Grep`, `Search`, `More`, `Panes`, `Recent`, `LookNext`, `LookPrev`), each sentence checked against its run (core/look.zig `lookAt` and `lookWalk`, core/exec.zig `executeFrom`, core/builtins.zig `search`, core/Query.zig `open`, core/Stream.zig `moreFor`) and the guide's chapters "Look" and "Search": Look (its argument's address forms, where a relative path is found, bare: the selection, else what is under the cursor), Exec (a builtin, else the line: typed into the terminal it runs from at an idle, empty prompt, else a command pane, `$SHELL -c`, `exit N`, Kill; run by name never a REPL's), Find and Grep (a query pane under the pane, line 1 the word and the argument; with a word listed, the keyboard left where it was, bare typed into; Find fuzzy over names, Grep the text as it is; 2000 lines and More; a script's search that finds nothing fails, `not found`), Search (line 1's first word names the source, `/` when none does; `SPC b b`, `SPC s s`, `SPC /`), More, Panes (open, then closed this session; Enter brings one back), Recent, LookNext and LookPrev (what a Look would open, walked through the panes, the keyboard with it); was: Grep "Find's sibling ... on the disk engine's worker", Exec with no word of where a command's output goes; docs/typ/builtins-tui.json regenerated
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/builtins.zig')
-rw-r--r--core/builtins.zig62
1 files changed, 49 insertions, 13 deletions
diff --git a/core/builtins.zig b/core/builtins.zig
index 11505b2c..5c29bf59 100644
--- a/core/builtins.zig
+++ b/core/builtins.zig
@@ -375,7 +375,14 @@ pub const registry = struct {
// ---- the two acme verbs ----
-/// Look at its argument: open the file or address it names, else find the word, as a right click does.
+/// Look at its argument as B3 does: open the file or address it names, else
+/// find the word.
+///
+/// `Look notes.txt:12` opens the file at line 12, or goes to the pane already
+/// showing it; an address may be a line, `:12:5`, `/re/`, a directory (a pane
+/// listing it) or a URL (the browser, by a plumbing rule). A relative path is
+/// found in the directory of the pane looked from, then of each pane on the
+/// jump list. Bare (Enter): the selection, else what is under the cursor.
pub const Look = struct {
pub const takes_arg = true;
pub const requires_arg = true;
@@ -390,7 +397,13 @@ pub const Look = struct {
}
};
-/// Execute its argument as a middle click on it would, a builtin or a shell command.
+/// Run its argument as B2 on it would: a builtin, else a shell command.
+///
+/// `Exec Newcol` runs the builtin. `Exec make test` runs the line: from a
+/// terminal at an idle, empty prompt, typed into its shell; from anywhere
+/// else, in a command pane (a terminal running `$SHELL -c` the line, which
+/// shows its output and `exit N` when it ends; Kill stops it). Run by name, a
+/// line is never a REPL's.
pub const Exec = struct {
pub const takes_arg = true;
pub const requires_arg = true;
@@ -1672,7 +1685,12 @@ pub const Mini = struct {
const e_search_miss_find = "Find: name not found";
const e_search_miss_grep = "Grep: text not found";
-/// List the files below this pane's directory whose names hold its argument, in a +Search.
+/// List the files below this pane's directory whose names match its argument.
+///
+/// A query pane under this pane, its line 1 `Find <name>`, the files under it
+/// by a fuzzy match of their names: with a word, listed, the keyboard left
+/// where it was; bare (`SPC f f`), typed into. Enter or B3 on a row opens
+/// that file. A script's Find that finds nothing fails, `not found`.
pub const Find = struct {
pub const takes_arg = true;
// A script's Find names what to find (bare, it is a key's prompt).
@@ -1685,9 +1703,10 @@ pub const Find = struct {
/// List the lines of the files below this pane's directory that hold its
/// argument.
///
-/// Find matches the files' names, Grep the lines of those files, on the disk
-/// engine's worker. A query pane under this pane: bare (`SPC f g`) typed
-/// into; with a word, listed.
+/// The text is matched as it is, not as a pattern, in a query pane under this
+/// pane, its line 1 `Grep <text>`: with a word, listed, the keyboard left
+/// where it was; bare (`SPC f g`), typed into. Past 2000 lines it stops, and
+/// More goes on. A script's Grep that finds nothing fails, `not found`.
pub const Grep = struct {
pub const takes_arg = true;
pub const requires_arg = true;
@@ -1715,8 +1734,11 @@ fn search(c: Ctx, source: panes.Query.Source, miss: []const u8) void {
/// Search in a query pane under this pane, its line 1 the argument.
///
-/// Any of the query pane's words (`Search Panes`, `Search Symbols lay`,
-/// `Search All needle`, `Search /re`); bare, `/`.
+/// Line 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.
pub const Search = struct {
pub const takes_arg = true;
pub const quiet = true;
@@ -1727,7 +1749,7 @@ pub const Search = struct {
}
};
-/// A query pane's Grep stopped at its 2000 lines goes on for 2000 more.
+/// Let a query pane's Grep stopped at its 2000 lines go on for 2000 more.
pub const More = struct {
pub const quiet = true;
pub fn run(c: Ctx) void {
@@ -1735,7 +1757,11 @@ pub const More = struct {
}
};
-/// Pick an open pane by its name in a query pane under this one (SPC b b).
+/// Pick a pane by its name, in a query pane under this one.
+///
+/// The open panes, then those closed this session, `(closed)`: Enter on one
+/// goes to it, or brings a closed one back where it was, its text with it.
+/// `Panes <name>` narrows them; `SPC b b` opens the same query.
pub const Panes = struct {
pub const takes_arg = true;
pub const quiet = true;
@@ -1891,7 +1917,11 @@ pub const Forward = struct {
}
};
-/// Select the next Look location across panes; Enter opens it.
+/// Select the next thing a Look would open: a place in a list, a word that
+/// names a file.
+///
+/// The walk goes on through the panes in order, the keyboard with it; Enter
+/// opens what it selected.
pub const LookNext = struct {
pub const quiet = true;
pub fn run(c: Ctx) void {
@@ -1899,7 +1929,9 @@ pub const LookNext = struct {
}
};
-/// Select the previous Look location across panes; Enter opens it.
+/// Select the previous thing a Look would open, as LookNext walks forward.
+///
+/// Enter opens what it selected.
pub const LookPrev = struct {
pub const quiet = true;
pub fn run(c: Ctx) void {
@@ -1924,7 +1956,11 @@ pub const Last = struct {
}
};
-/// List the files opened lately, closed ones too, each a place to open again.
+/// List the files opened lately, closed ones too, in a query pane under this
+/// one.
+///
+/// `Recent <name>` narrows them by name; bare (`SPC f r`), typed into. Enter
+/// opens the current one; B3 on a row, that one.
pub const Recent = struct {
pub const scope: Scope = .session;
pub const takes_arg = true;