summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index 500ce264..cf144d33 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -106,6 +106,36 @@ pub fn Builtin() type {
return @Enum(Tag, .exhaustive, &names, &std.simd.iota(Tag, cmds.len));
}
+// ---- the two acme verbs ----
+
+// Look and Execute are the verbs the whole environment is built on, and they
+// are BUILTINS: `Look main.zig` typed in a tag and executed is the same look a
+// right click on `main.zig` is, `Exec ls` the same as a middle click on `ls`.
+// The mouse buttons and Enter/Tab are not a second path into them any more —
+// they are two bindings pointing here (config.look_cmd / exec_cmd), the status
+// `SPC f s` has relative to Save. That is the whole feature: what used to be a
+// `button` parameter threaded through every keyboard call site, with the
+// builtin dispatch nested INSIDE it, is now one word each.
+//
+// The operand is `arg` in both — a name's tail (`Look main.zig`), else the
+// selection a chord kept, else the word the gesture pointed at, which the
+// gesture resolves and passes. Nothing to act on means nothing happens, the
+// way `Save` on a terminal is inert.
+
+pub const Look = struct {
+ pub fn run(c: Ctx) void {
+ c.p.lookAt(c.id, c.arg orelse return);
+ }
+};
+
+pub const Exec = struct {
+ pub fn run(c: Ctx) void {
+ // the destination pane is Look's business (it focuses what answered);
+ // an execute deliberately leaves you where you were
+ _ = c.p.execute(c.id, c.arg orelse return);
+ }
+};
+
// ---- session ----
pub const Kill = struct {
@@ -159,8 +189,8 @@ pub const Crt = struct {
};
// The image pane's three renderer toggles. They used to be words the image tag
-// printed and actOnSelection matched by hand; as builtins they are executable
-// anywhere, pressable under SPC and listed by `SPC ?`, which is the whole
+// printed and the execute dispatcher matched by hand; as builtins they are
+// executable anywhere, pressable under SPC and listed by `SPC ?`, the whole
// reason the tag no longer carries them. Each acts on the pane it runs in and
// is inert anywhere else, the way Save is on a terminal — flipping the field is
// the whole toggle: drawImage re-matches the glyph grid when it sees