From a3e38a8fd01c54b1fab8a7eaf225ac6147c74330 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 4 Nov 2026 23:58:54 -0300 Subject: File, terminal, edit: undo and redo are one undoStep(back) each, as Text.step already is, and their callers (normal, builtins, edit_cmd, file_watch, ninep/ctl's pager test, test/panes) say which way Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- test/panes.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/panes.zig b/test/panes.zig index b111f5d1..f85daab3 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -1213,7 +1213,7 @@ test "terminal edits and undo survive partial history clearing and whole-screen try std.testing.expectEqualStrings("edit one\nedit two", snapshot.ovl.?.text); } try std.testing.expectEqual(@as(usize, 2), pane.terminal.?.vt.screens.active.pages.countTrackedPins()); - panes.terminal.undo(p, pane); + panes.terminal.undoStep(p, pane, true); try std.testing.expectEqualStrings("edit one\nedit two", pane.ovl.?.text); try std.testing.expectEqual(expected, pane.ovl.?.row); } @@ -1430,24 +1430,24 @@ test "file history owns bounded snapshot storage without per-edit bookkeeping al const current = file.content; failing.fail_index = failing.alloc_index; panes.File.pushUndo(p, pane); - panes.File.undo(p, pane); + panes.File.undoStep(p, pane, true); try std.testing.expectEqual(current.ptr, file.content.ptr); try std.testing.expectEqual(pardes.memory.limits.undo_max, history.undo_len); try std.testing.expectEqual(@as(usize, 0), history.redo_len); failing.fail_index = std.math.maxInt(usize); const before = failing.alloc_index; - panes.File.undo(p, pane); + panes.File.undoStep(p, pane, true); try std.testing.expectEqual(before + 2, failing.alloc_index); try std.testing.expectEqual(@as(usize, 1), file.line_starts.len); try std.testing.expectEqual(@as(usize, 1), history.redo_len); const undone = file.content; failing.fail_index = failing.alloc_index; - panes.File.redo(p, pane); + panes.File.undoStep(p, pane, false); try std.testing.expectEqual(undone.ptr, file.content.ptr); try std.testing.expectEqual(@as(usize, 1), history.redo_len); failing.fail_index = std.math.maxInt(usize); const before_redo = failing.alloc_index; - panes.File.redo(p, pane); + panes.File.undoStep(p, pane, false); try std.testing.expectEqual(before_redo + 2, failing.alloc_index); try std.testing.expectEqual(pardes.memory.limits.undo_max, history.undo_len); try std.testing.expectEqual(@as(usize, 0), history.redo_len); -- cgit v1.3