summaryrefslogtreecommitdiff
path: root/src/Pipe.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Pipe.zig')
-rw-r--r--src/Pipe.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Pipe.zig b/src/Pipe.zig
index 1f0ee5fc..3045d738 100644
--- a/src/Pipe.zig
+++ b/src/Pipe.zig
@@ -446,7 +446,7 @@ test "selection pipe replaces all ranges atomically and undo restores them" {
const outputs: []const []const u8 = &.{ "AA\n", "" };
p.update(.{ .pipe_resp = .{ .id = id, .success = true, .outputs = outputs } });
try std.testing.expectEqualSlices(u8, "AA bb \n", pane.file.?.content);
- try std.testing.expectEqual(@as(usize, 1), pane.file.?.history.undo_len);
+ try std.testing.expectEqual(@as(usize, 1), pane.file.?.history.journal.done);
try std.testing.expectEqual(@as(u16, 1), pane.body.nsel);
try std.testing.expectEqual(@as(i32, 1), pane.body.cur_col);
try std.testing.expectEqual(@as(i32, 6), pane.body.sels[0].col);
@@ -514,7 +514,7 @@ test "a command with no stdin runs once and every cursor gets that one answer" {
p.update(.{ .pipe_resp = .{ .id = id, .success = true, .outputs = &.{"T"} } });
try std.testing.expectEqualSlices(u8, "Taa bb Tcc\n", pane.file.?.content);
- try std.testing.expectEqual(@as(usize, 1), pane.file.?.history.undo_len);
+ try std.testing.expectEqual(@as(usize, 1), pane.file.?.history.journal.done);
}
test "selection pipe failure and stale completion never mutate the file" {
@@ -532,7 +532,7 @@ test "selection pipe failure and stale completion never mutate the file" {
const failed_id = nextPipeEffect(p) orelse return error.MissingPipeEffect;
p.update(.{ .pipe_resp = .{ .id = failed_id, .success = false, .outputs = &.{} } });
try std.testing.expectEqualSlices(u8, "abc\n", pane.file.?.content);
- try std.testing.expectEqual(@as(usize, 0), pane.file.?.history.undo_len);
+ try std.testing.expectEqual(@as(usize, 0), pane.file.?.history.journal.done);
p.update(.{ .key = .{ .cp = '|' } });
p.update(.{ .key = .{ .cp = 'c', .text = "cat" } });
@@ -541,7 +541,7 @@ test "selection pipe failure and stale completion never mutate the file" {
panes.File.setContent(p, &pane.file.?, try gpa.dupe(u8, "changed\n"));
p.update(.{ .pipe_resp = .{ .id = stale_id, .success = true, .outputs = &.{"ABC"} } });
try std.testing.expectEqualSlices(u8, "changed\n", pane.file.?.content);
- try std.testing.expectEqual(@as(usize, 0), pane.file.?.history.undo_len);
+ try std.testing.expectEqual(@as(usize, 0), pane.file.?.history.journal.done);
}
test "a failed filter opens an errors buffer carrying the command's own words" {
@@ -570,7 +570,7 @@ test "a failed filter opens an errors buffer carrying the command's own words" {
// The text is untouched — a failed filter is not an edit...
try std.testing.expectEqualSlices(u8, "abc\n", pane.file.?.content);
- try std.testing.expectEqual(@as(usize, 0), pane.file.?.history.undo_len);
+ try std.testing.expectEqual(@as(usize, 0), pane.file.?.history.journal.done);
// ...and the cursor did not go anywhere, so `|` again edits the same file.
try std.testing.expectEqual(@as(usize, 0), p.active);
@@ -603,7 +603,7 @@ test "selection pipe rejects a reused pane slot and a superseded request" {
pane = try p.setTestFile("new\n"); // same slot, different serial
p.update(.{ .pipe_resp = .{ .id = replaced_id, .success = true, .outputs = &.{"OLD"} } });
try std.testing.expectEqualSlices(u8, "new\n", pane.file.?.content);
- try std.testing.expectEqual(@as(usize, 0), pane.file.?.history.undo_len);
+ try std.testing.expectEqual(@as(usize, 0), pane.file.?.history.journal.done);
pane.body.cur_col = 2;
pane.body.vsel = .{ .active = true, .row = 0, .col = 0, .explicit = true };
@@ -621,7 +621,7 @@ test "selection pipe rejects a reused pane slot and a superseded request" {
try std.testing.expectEqualSlices(u8, "new\n", pane.file.?.content);
p.update(.{ .pipe_resp = .{ .id = latest_id, .success = true, .outputs = &.{"NEW"} } });
try std.testing.expectEqualSlices(u8, "NEW\n", pane.file.?.content);
- try std.testing.expectEqual(@as(usize, 1), pane.file.?.history.undo_len);
+ try std.testing.expectEqual(@as(usize, 1), pane.file.?.history.journal.done);
}
test "selection pipe binding is file-normal-only" {