summaryrefslogtreecommitdiff
path: root/core/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-23 16:05:56 -0300
committerGabriel Schneider <[email protected]>2026-11-23 16:06:33 -0300
commit3dfa6a9d9a788e89291efb035327cd181c196749 (patch)
treea187d002d56c803add517cb7cdc2d392ce517d8a /core/builtins.zig
parentb1f5c788ddd14b832452c83524e2de527b0a0af0 (diff)
downloadpardes-3dfa6a9d9a788e89291efb035327cd181c196749.tar.gz
pardes-3dfa6a9d9a788e89291efb035327cd181c196749.zip
help: the rest of the builtins documented for a user (item 5's eighth group: `NextColor`, `Themes`, `ThemeFile`, `DumpThemes`, `Fonts`, `TreeContext`, `Palette`, `Ascii`, the five clipboard words, `Tutor`, `DumpConfig`, `LocationsConfig`, `Messages`, `Mini`, `Back`, `Forward`, `Last`, `Jumplist`, `Edit`, `Undo`, `Redo`; `Help`, `Config`, `Build`, `Changelog`, `Addon`, `Petscii`, `Incl` and `Plumb` as the earlier changes wrote them), each sentence checked against its run (core/builtins.zig; core/Output.zig `openThemes`, `fontsListed`; core/locations.zig `Config.parse`; core/mini.zig `open`; core/edit.zig `clipYank`; core/sam_edit.zig's list of what is left out of sam): Themes and Fonts (each a `Theme <name>`, `Font <name>` line to run), ThemeFile and DumpThemes (each names the other), TreeContext, Palette and Ascii (`on`/`off`, `commodore`/`terminal`, bare flips; was lower-case fragments, "the C64 palette or the terminal's own 16"), ClipYank (every cursor's selection, joined; an image's or a PDF's selection), DumpConfig, LocationsConfig (its four fields as typed; bare, +LocationsConfig), Mini (`Mini notes.txt`; drawn once, again at the next Mini), Back (a closed file's place opens it again), Last (with none, the pane beside), Jumplist (+Jumps), Edit (`Edit ,s/old/new/g`; what of sam's is left out), Undo and Redo; 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.zig81
1 files changed, 59 insertions, 22 deletions
diff --git a/core/builtins.zig b/core/builtins.zig
index 626e8ec3..dfa0b534 100644
--- a/core/builtins.zig
+++ b/core/builtins.zig
@@ -792,7 +792,7 @@ pub const NextColor = struct {
}
};
-/// List the themes in a pane, each a word to click.
+/// List the bundled themes in a +Themes, each a `Theme <name>` line to run.
pub const Themes = struct {
pub const scope: Scope = .session;
pub const output: OutputTraits = .{ .name = config.themes_buffer, .steps = true, .commands = true };
@@ -801,7 +801,9 @@ pub const Themes = struct {
}
};
-/// Load a theme from a file.
+/// Load a theme from a .zon file: `ThemeFile ~/themes/mine.zon`.
+///
+/// DumpThemes writes the bundled ones out to start from.
pub const ThemeFile = struct {
pub const scope: Scope = .session;
pub const takes_arg = true;
@@ -818,7 +820,10 @@ pub const ThemeFile = struct {
}
};
-/// Write the bundled themes into the config directory's themes, to edit.
+/// Write the bundled themes into the configuration directory's themes, to
+/// edit.
+///
+/// ThemeFile loads one back.
pub const DumpThemes = struct {
pub const scope: Scope = .session;
pub fn run(c: Ctx) void {
@@ -830,7 +835,7 @@ pub const DumpThemes = struct {
}
};
-/// List the fonts in a pane, each a word to click.
+/// List this machine's fonts in a +Fonts, each a `Font <name>` line to run.
pub const Fonts = struct {
pub const scope: Scope = .session;
pub const output: OutputTraits = .{ .name = config.fonts_buffer, .steps = true, .commands = true };
@@ -842,7 +847,10 @@ pub const Fonts = struct {
}
};
-/// Show the declarations enclosing the top row at the pane's head, on or off.
+/// Show, at the pane's head, the declarations its top row is in.
+///
+/// `TreeContext on` or `off` sets it; bare, it flips. Only a source file the
+/// parser knows has them.
pub const TreeContext = struct {
pub const takes_arg = true;
@@ -906,7 +914,10 @@ pub const Petscii = struct {
}
};
-/// the C64 palette or the terminal's own 16
+/// Draw an image pane's glyph art in the C64 palette, or in the terminal's
+/// own 16 colours.
+///
+/// `Palette commodore` or `Palette terminal` sets it; bare, it flips.
pub const Palette = struct {
pub const needs: PaneKind = .image;
pub const takes_arg = true;
@@ -920,7 +931,10 @@ pub const Palette = struct {
}
};
-/// add the printable ASCII bitmaps to the matcher's glyph set
+/// Add the printable ASCII glyphs to those an image pane's glyph art is made
+/// of, or take them out.
+///
+/// `Ascii on` or `off` sets it; bare, it flips.
pub const Ascii = struct {
pub const needs: PaneKind = .image;
pub const takes_arg = true;
@@ -937,14 +951,19 @@ pub const Ascii = struct {
// ---- the system clipboard ----
/// Copy the selection to the system clipboard.
+///
+/// Every cursor's selection, joined; in an image or a PDF's pane, what it has
+/// selected.
pub const ClipYank = struct {
pub fn run(c: Ctx) void {
edit.clipYank(c.p, c.pane, false);
}
};
-/// helix `<space>Y`: the PRIMARY selection alone, where `SPC y` joins every
-/// cursor's. One cursor makes them the same word.
+/// Copy the primary selection alone to the system clipboard.
+///
+/// ClipYank (`SPC y`) copies every cursor's selection, joined; with one
+/// cursor the two are the same.
pub const ClipYankMain = struct {
pub fn run(c: Ctx) void {
edit.clipYank(c.p, c.pane, true);
@@ -1359,8 +1378,10 @@ pub const Togglettymode = struct {
/// Run a command of sam's language over the open text panes, starting in this
/// pane's body.
///
-/// As acme's Edit: from a tag, a pane's ctl or an exec. One undo step in each
-/// file it changes; a failure changes nothing and says why.
+/// `Edit ,s/old/new/g` changes every old to new in this pane's text. As
+/// acme's Edit: from a tag, a pane's ctl or an exec; one undo step in each
+/// file it changes; a failure changes nothing and says why. Left out of
+/// sam's: the `'` address, `B <cmd` and `D <cmd`, and `\1` to `\9` in `s`.
pub const Edit = struct {
// acme's Edit (exec.c `edit`, edit.c). core/edit_cmd.zig runs it;
// core/sam_edit.zig has what is left out.
@@ -1373,8 +1394,8 @@ pub const Edit = struct {
/// Step the pane's text back one edit.
///
-/// With no step left, it says so and changes nothing; a ctl write of it still
-/// succeeds, as acme's Undo is silent there. A file keeps 256 steps.
+/// With no step left, it says so and changes nothing (a ctl write of it still
+/// succeeds, as acme's Undo is silent there). A file keeps 256 steps.
pub const Undo = struct {
// acme's Undo and Redo (exec.c `undo`); limits.undo_max steps.
pub fn run(c: Ctx) void {
@@ -1384,7 +1405,9 @@ pub const Undo = struct {
}
};
-/// Redo the last undone edit.
+/// Step the pane's text forward again, one edit Undo took back.
+///
+/// With none left, it says so and changes nothing.
pub const Redo = struct {
pub fn run(c: Ctx) void {
if (@import("edit_cmd.zig").busyOn(c.p, c.id)) return c.p.reportFailure(c.id, "Redo: " ++ @import("edit_cmd.zig").e_busy);
@@ -1634,8 +1657,10 @@ fn openConfigFile(c: Ctx, name: []const u8, path: []const u8, initial: []const u
c.p.view().active = free;
}
-/// Open the settings in effect, each a word to click, and the startup
-/// file's path.
+/// Show the settings in effect in a +DumpConfig, as lines the startup file
+/// takes.
+///
+/// The startup file's path with them; a line run there is that setting.
pub const DumpConfig = struct {
pub const scope: Scope = .session;
pub const output: OutputTraits = .{ .name = config.dump_config_buffer };
@@ -1644,7 +1669,12 @@ pub const DumpConfig = struct {
}
};
-/// Set how location rows are drawn, or show how they are when bare.
+/// Set how a list's location rows are drawn: `LocationsConfig layout:inline
+/// context:2`.
+///
+/// Its fields: `context:<lines>` around each, `tscontext:on|off`,
+/// `tslocations:on|off`, `layout:inline|stacked`; those not given stay. Bare,
+/// it shows them in a +LocationsConfig.
pub const LocationsConfig = struct {
pub const scope: Scope = .session;
pub const takes_arg = true;
@@ -1675,7 +1705,7 @@ pub const LocationsConfig = struct {
}
};
-/// Open the messages shown so far.
+/// Show the messages said so far in a +Messages.
pub const Messages = struct {
pub const scope: Scope = .session;
pub const output: OutputTraits = .{ .name = config.messages_buffer };
@@ -1707,7 +1737,10 @@ pub const Changelog = struct {
}
};
-/// Open a minimap of the file in braille dots.
+/// Map a file of this pane's directory in braille dots: `Mini notes.txt`.
+///
+/// A pane of its own, drawn once: a Mini of the same file again draws it
+/// anew.
pub const Mini = struct {
pub const takes_arg = true;
pub const requires_arg = true; // a file to map: bare, wrong #args (EINVAL)
@@ -1943,7 +1976,9 @@ pub const Window = struct {
// ---- the jump group ----
-/// Ctrl-o: one step back into the history.
+/// Go one step back in the jump history.
+///
+/// A place in a file closed since opens the file again.
pub const Back = struct {
pub const scope: Scope = .session;
pub fn run(c: Ctx) void {
@@ -1951,7 +1986,7 @@ pub const Back = struct {
}
};
-/// Ctrl-i: one step forward again, up to wherever Back started.
+/// Go one step forward again in the jump history, up to where Back started.
pub const Forward = struct {
pub const scope: Scope = .session;
pub fn run(c: Ctx) void {
@@ -1982,6 +2017,8 @@ pub const LookPrev = struct {
};
/// Go back to the last place jumped from in another pane.
+///
+/// With none, to the pane beside this one.
pub const Last = struct {
pub fn run(c: Ctx) void {
var i = c.p.view().jumps.n;
@@ -2034,7 +2071,7 @@ pub const History = struct {
}
};
-/// List the places jumped from, each a place to go.
+/// List the places jumped from in a +Jumps, each a place to go.
pub const Jumplist = struct {
pub const scope: Scope = .session;
pub const output: OutputTraits = .{ .name = config.jumps_buffer, .steps = true, .locations = true };