summaryrefslogtreecommitdiff
path: root/src/rollback.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/rollback.zig')
-rw-r--r--src/rollback.zig13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/rollback.zig b/src/rollback.zig
index b5f4e966..d87671e6 100644
--- a/src/rollback.zig
+++ b/src/rollback.zig
@@ -350,7 +350,7 @@ pub const Copy = struct {
// the speculation freed would come back as that. Not the
// queues a step drains (undefined between steps), nor the
// authority's.
- if (attr.@"comptime" or comptime (annotated(T, "authority", name) or (annotated(T, "local", name) and unsaved(name)))) continue;
+ if (attr.@"comptime" or comptime (annotated(T, "authority", name) or ((annotated(T, "local", name) or annotated(T, "derived", name)) and unsaved(name)))) continue;
if (comptime opaqueTo(F)) continue;
c.where = @typeName(T) ++ "." ++ name;
c.pinnable = comptime pinned(T, name);
@@ -390,7 +390,7 @@ pub const Copy = struct {
const s = @typeInfo(T).@"struct";
inline for (s.field_names, s.field_types, s.field_attrs) |name, F, attr| {
if (attr.@"comptime") continue;
- if (comptime annotated(T, "local", name) and unsaved(name)) continue;
+ if (comptime (annotated(T, "local", name) or annotated(T, "derived", name)) and unsaved(name)) continue;
const at = @intFromPtr(&@field(v, name));
if (comptime walk.lengthOf(T, name) != null and @typeInfo(F) == .array) {
try c.save(at, walk.lengthIn(v, comptime walk.lengthOf(T, name).?) * @sizeOf(@typeInfo(F).array.child));
@@ -429,10 +429,13 @@ fn annotatedStruct(comptime T: type) bool {
}
/// The queues every step drains (empty between steps, asserted when a copy
-/// is taken: what is in their slots is nothing), and the frame statistics
-/// (numbers, and a static name).
+/// is taken: what is in their slots is nothing), the frame statistics
+/// (numbers, and a static name), and the rows a terminal was last read as
+/// (a grid's worth of text, emptied when a copy is taken and when it is
+/// put back: src/replica.zig).
fn unsaved(comptime name: []const u8) bool {
- return std.mem.eql(u8, name, "effects") or std.mem.eql(u8, name, "in_q") or std.mem.eql(u8, name, "frames");
+ return std.mem.eql(u8, name, "effects") or std.mem.eql(u8, name, "in_q") or std.mem.eql(u8, name, "frames") or
+ std.mem.eql(u8, name, "shell_rows");
}
fn annotated(comptime T: type, comptime kind: []const u8, comptime name: []const u8) bool {