summaryrefslogtreecommitdiff
path: root/test/panes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/panes.zig')
-rw-r--r--test/panes.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/panes.zig b/test/panes.zig
index 301568c1..5562105e 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -1016,7 +1016,7 @@ test "terminal output keeps following new rows after scrollback eviction" {
try std.testing.expect(pages.page_size <= pages.limits.max(.bytes));
const sb = pages.scrollbar();
try std.testing.expectEqual(sb.total - pane.rows, sb.offset);
- const full = try panes.terminal.screenTextAlloc(pane, gpa);
+ const full = try pardes.Term.scrollback(pane.terminal, gpa);
defer gpa.free(full);
var last_buf: [16]u8 = undefined;
const last = try std.fmt.bufPrint(&last_buf, "row-{d:0>5}", .{(phase + 1) * 20_000 - 1});
@@ -1080,7 +1080,7 @@ test "terminal edit stays on its surviving row when old scrollback is evicted" {
}
}
try std.testing.expect(removed > 0 and removed < original_row);
- const full = try panes.terminal.screenTextAlloc(pane, gpa);
+ const full = try pardes.Term.scrollback(pane.terminal, gpa);
defer gpa.free(full);
const row = original_row - @as(i32, @intCast(removed));
try std.testing.expectEqualStrings(last, modal.lineSlice(full, @intCast(row)));
@@ -1111,7 +1111,7 @@ test "terminal edits and undo survive partial history clearing and whole-screen
pane.body.cur_col = 4;
pane.body.cur_pinned = true;
pane.body.vsel = .{ .active = true, .row = row, .col = 1 };
- try panes.terminal.pushUndo(p, pane);
+ try pane.body.remember(p.gpa, pane.ovl);
const overlay = pane.ovl.?;
pane.body.ed_redo[0] = .{
.ovl = .{ .row = overlay.row, .rows = overlay.rows, .text = try gpa.dupe(u8, overlay.text) },
@@ -1153,7 +1153,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());
- try panes.terminal.undoStep(p, pane, true);
+ try pardes.edit.undoStep(p, &pane.body, true);
try std.testing.expectEqualStrings("edit one\nedit two", pane.ovl.?.text);
try std.testing.expectEqual(expected, pane.ovl.?.row);
}
@@ -1170,7 +1170,7 @@ test "terminal lower scroll regions do not move edits above them" {
pane.ovl = .{ .row = 1, .rows = 1, .text = try gpa.dupe(u8, "unsent") };
pane.body.cur_row = 1;
pane.body.cur_pinned = true;
- try panes.terminal.pushUndo(p, pane);
+ try pane.body.remember(p.gpa, pane.ovl);
const total = pardes.Term.grid(pane.terminal).total;
var setup: [64]u8 = undefined;
const bytes = try std.fmt.bufPrint(&setup, "\x1b[4;{d}r\x1b[{d};1H", .{ pane.rows, pane.rows });
@@ -1180,7 +1180,7 @@ test "terminal lower scroll regions do not move edits above them" {
try std.testing.expectEqual(@as(i32, 1), pane.ovl.?.row);
try std.testing.expectEqual(@as(i32, 1), pane.body.cur_row);
try std.testing.expectEqual(@as(i32, 1), pane.body.ed_undo[0].ovl.?.row);
- const full = try panes.terminal.screenTextAlloc(pane, gpa);
+ const full = try pardes.Term.scrollback(pane.terminal, gpa);
defer gpa.free(full);
try std.testing.expect(std.mem.startsWith(u8, full, "top\nsecond\nthird\n"));
}
@@ -1210,7 +1210,7 @@ test "terminal eviction and lower-region scrolling in one read preserve a surviv
pane.ovl = .{ .row = old_row, .rows = 1, .text = try gpa.dupe(u8, "kept edit") };
pane.body.cur_row = old_row;
pane.body.cur_pinned = true;
- try panes.terminal.pushUndo(p, pane);
+ try pane.body.remember(p.gpa, pane.ovl);
const old_total = pages.total_rows;
var buf: [128]u8 = undefined;
const bytes = try std.fmt.bufPrint(&buf, "new\r\n\x1b[4;{d}r\x1b[{d};1Hregion\r\n", .{ pane.rows, pane.rows });