summaryrefslogtreecommitdiff
path: root/src/replica.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 00:38:41 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit26929e67111e843db4ad27abb4f1341cf396158c (patch)
tree8540497ac35231593742c17fb6df03ec0a16a76f /src/replica.zig
parent1d382a3ed42788e82301d0ce2a16ebc35c79046c (diff)
downloadpardes-26929e67111e843db4ad27abb4f1341cf396158c.tar.gz
pardes-26929e67111e843db4ad27abb4f1341cf396158c.zip
Term: text through the interface, the editing of the copy back to the core: Term.scrollback and Term.scrollbackLen are its whole history as plain text (its body, Save), Term.textRows its rows as text with a prompt's own cells cut off (a plain Term.Rows), Term.viewport the rows its view shows, Term.promptPrefix how many bytes of a row are its prompt and Term.markRead says a step read them; the editing of the copy of a terminal's rows is the core's again, in edit.zig beside the text it edits: shellRows and the rows' cache (edit.RowsCache, edit.drawing), terminalLines (the rows with the copy spliced in), and in edit.zig's own flatSurface, editText, setEditText, pushUndo and undoStep the terminal's arms written out where they were dispatched to terminal.zig; the body's walk over the rows and the copy (BodyWalk) is body_layer.zig's, beside the bodyText it makes; screenTextAlloc, screenTextLen, cursorLines, flatSurface, editText, setEditText, pushUndo, undoStep and bodyText leave terminal.zig; nothing else changes
Diffstat (limited to 'src/replica.zig')
-rw-r--r--src/replica.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/replica.zig b/src/replica.zig
index 9a2c80a7..fa6cfadb 100644
--- a/src/replica.zig
+++ b/src/replica.zig
@@ -3422,7 +3422,7 @@ test "a delta applied under a speculation outlives its rollback: the terminal st
try std.testing.expect(r.copy.held);
try deliver(a, &screens, peer, r, .flush);
// The rows the core keeps, read once under the copy.
- _ = try terminal.shellRows(r.core(), r.core().panes[shell].?);
+ _ = try pardes.edit.shellRows(r.core(), r.core().panes[shell].?);
}
for (sent.items) |m| {
r.confirm(try a.take(m));
@@ -3436,7 +3436,7 @@ test "a delta applied under a speculation outlives its rollback: the terminal st
// another's unit puts the copy back: the rows it kept are of an older
// grid and must not be read.
r.confirm(try a.local(.{ .focus = false }));
- _ = try terminal.shellRows(r.core(), r.core().panes[shell].?);
+ _ = try pardes.edit.shellRows(r.core(), r.core().panes[shell].?);
try key(r, 'x', &sent);
for (0..40) |i| a.output(.{ .output = .{ .pane = shell, .bytes = try std.fmt.bufPrint(&line, "last line {d}\r\n", .{i}) } });
r.confirm((try a.pending()).?);
@@ -3445,8 +3445,8 @@ test "a delta applied under a speculation outlives its rollback: the terminal st
r.confirm(try a.local(.{ .focus = true }));
r.settle();
const n = a.core.panes[shell].?.rows;
- const back = try terminal.shellRows(r.core(), r.core().panes[shell].?);
- const now = try terminal.shellRows(a.core, a.core.panes[shell].?);
+ const back = try pardes.edit.shellRows(r.core(), r.core().panes[shell].?);
+ const now = try pardes.edit.shellRows(a.core, a.core.panes[shell].?);
for (now[now.len - n ..], back[back.len - n ..]) |x, y| try std.testing.expectEqualStrings(x, y);
for (sent.items) |m| {
r.confirm(try a.take(m));
@@ -3463,8 +3463,8 @@ test "a delta applied under a speculation outlives its rollback: the terminal st
try screen_state.dumpScreen(&a.core.panes[shell].?.terminal.?.vt, &dump_a.writer);
try screen_state.dumpScreen(&r.core().panes[shell].?.terminal.?.vt, &dump_r.writer);
try std.testing.expectEqualStrings(dump_a.written(), dump_r.written());
- const rows_a = try terminal.shellRows(a.core, a.core.panes[shell].?);
- const rows_r = try terminal.shellRows(r.core(), r.core().panes[shell].?);
+ const rows_a = try pardes.edit.shellRows(a.core, a.core.panes[shell].?);
+ const rows_r = try pardes.edit.shellRows(r.core(), r.core().panes[shell].?);
// As many rows (the history is the authority's to the row), the screen's
// the same; above it, rows scrolled past more than a screen at once are
// holes until fetched.