summaryrefslogtreecommitdiff
path: root/test/panes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/panes.zig')
-rw-r--r--test/panes.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/panes.zig b/test/panes.zig
index 28f14d94..e2cd85dc 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -2007,6 +2007,14 @@ test "terminal edits and undo survive partial history clearing and whole-screen
};
p.update(.{ .output = .{ .pane = 0, .bytes = bytes } });
const expected: i32 = if (action == .clear_history) 2 else 0;
+ // The copy's top row was in the history ED 3 erased: the copy goes
+ // with it (terminal.zig's rule for rows that are gone), and the
+ // selection made in it too. Undo still has it, at the top.
+ if (action == .partial_clear_history) {
+ try std.testing.expect(pane.ovl == null);
+ try std.testing.expect(!pane.body.vsel.active);
+ }
+ if (action == .clear_history) try std.testing.expect(pane.ovl != null);
if (pane.ovl) |edit| {
try std.testing.expectEqual(expected, edit.row);
try std.testing.expectEqual(@as(i32, if (action == .clear_history or action == .partial_clear_history) 2 else 1), edit.rows);