From 964709e115126aafa6fd5d8c984d511cf68cecaf Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 02:17:14 -0300 Subject: Undo and Redo with nothing left say so, and the write succeeds A pane's Undo or Redo with no step left did nothing and said nothing. It now says "Undo: nothing to undo" (or Redo's) as a message, not a failure, so a ctl write of it still succeeds as acme's silent Undo does. The docs give the 256-step history. Co-Authored-By: Claude Opus 5.5 --- src/ninep/ctl.zig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ninep') diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index 0f22614c..d6922390 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -724,6 +724,12 @@ test "Undo and Redo on a pane's ctl step its body through its edits" { try testing.expectEqualStrings("one\n", rd(p, body, 0, 64).bytes); try testing.expectEqual(Status.ok, wr(p, Node.of(serial, .ctl), "Redo").reply.status); try testing.expectEqualStrings("one\ntwo\n", rd(p, body, 0, 64).bytes); + // Nothing left: said, and the write still succeeds, as acme's is silent. + try testing.expectEqual(Status.ok, wr(p, Node.of(serial, .ctl), "Redo").reply.status); + try testing.expect(th.logHas(p, "Redo: nothing to redo")); + _ = wr(p, Node.of(serial, .ctl), "Undo"); + try testing.expectEqual(Status.ok, wr(p, Node.of(serial, .ctl), "Undo").reply.status); + try testing.expect(th.logHas(p, "Undo: nothing to undo")); } test "focus reads the pane with the keyboard, and a serial written to it moves the keyboard there" { -- cgit v1.3