diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-04 23:58:54 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 01:16:28 -0300 |
| commit | a3e38a8fd01c54b1fab8a7eaf225ac6147c74330 (patch) | |
| tree | a2f697389827f58bf6c6c69302b789bc770de889 /test/panes.zig | |
| parent | 54b0c95fc5522b5ad48d857bb0a08c253c17ece3 (diff) | |
| download | pardes-a3e38a8fd01c54b1fab8a7eaf225ac6147c74330.tar.gz pardes-a3e38a8fd01c54b1fab8a7eaf225ac6147c74330.zip | |
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 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/panes.zig')
| -rw-r--r-- | test/panes.zig | 10 |
1 files changed, 5 insertions, 5 deletions
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); |
