From cf45be79a5ab96d3b81078e7e5e2ba58bd5e5cee Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 17:25:41 -0300 Subject: Undo and Redo are builtins, as in acme's tags, so a pane's ctl and exec can step its body Over 9P there was no way to take back an edit: acme's Undo and Redo were keys only. They are now pane builtins, reached from a tag, a pane ctl and exec, and listed in /commands. They are not added to the default tags, which would change every tag. Co-Authored-By: Claude Opus 5.5 --- src/builtins.zig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/builtins.zig') diff --git a/src/builtins.zig b/src/builtins.zig index 23d853c8..a755969b 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -850,6 +850,20 @@ pub const Togglettymode = struct { } }; +/// acme's Undo and Redo (exec.c `undo`): step the pane's body back or +/// forward through its edits, from a tag, a pane ctl or exec. +pub const Undo = struct { + pub fn run(c: Ctx) void { + edit.doUndo(c.p, &c.pane.body); + } +}; + +pub const Redo = struct { + pub fn run(c: Ctx) void { + edit.doRedo(c.p, &c.pane.body); + } +}; + /// Fold a pane to its tag, or restore its share of the column. pub const Collapse = struct { pub fn run(c: Ctx) void { -- cgit v1.3