diff options
Diffstat (limited to 'src/locations.zig')
| -rw-r--r-- | src/locations.zig | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/locations.zig b/src/locations.zig index d0904607..b14b3a2c 100644 --- a/src/locations.zig +++ b/src/locations.zig @@ -24,6 +24,19 @@ pub const Row = struct { location_end: usize, code_start: usize, colors: []u8 = &.{}, + + /// The replay digest's (src/walk.zig): all of it but its colours. They + /// are painted from what this process has painted (the owner's + /// highlights a frame made, the locations cache: both derived), so a + /// client joined from a dump, or one that drew another view, colours a + /// row its session left plain. They are how a row looks, not where it + /// points; a dump keeps them. + pub fn digest(r: *const Row, h: *pardes.walk.Hasher) void { + inline for (@typeInfo(Row).@"struct".field_names) |name| { + if (comptime std.mem.eql(u8, name, "colors")) continue; + pardes.walk.hash(@FieldType(Row, name), &@field(r, name), h); + } + } }; /// Raw (no safe build's overwrite): a replica's rollback copy pins a row |
