diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-30 23:48:44 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-30 23:54:48 -0300 |
| commit | 3d4da8184f41307d8348f7e0595bba238e8976b4 (patch) | |
| tree | ef65983504dc5614b92d29253825201015eac41d /src/replica.zig | |
| parent | 793081277cb46143e3ccd80ae1d868febacf3fbd (diff) | |
| download | pardes-3d4da8184f41307d8348f7e0595bba238e8976b4.tar.gz pardes-3d4da8184f41307d8348f7e0595bba238e8976b4.zip | |
panes: a pane's view (Pane.view, and a parked view's share of it) is digested and dumped, no longer derived: a key's move reads it before its step syncs (halfPageMove, ensureCursorVisible, through File.geometry), and a core loaded from a dump had the default, Wrap on and no row heights, so a window that joined after `SPC t w` scrolled further at the terminal view's next Ctrl-D (the box soak's `pane 23.file.scroll`, seed 7: win207-3 at its join); replica.zig's test, main's fails at `pane 0.file.scroll`
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/replica.zig')
| -rw-r--r-- | src/replica.zig | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/replica.zig b/src/replica.zig index 4f84712f..ca8612a9 100644 --- a/src/replica.zig +++ b/src/replica.zig @@ -4123,6 +4123,35 @@ test "a client that diverged joins again for its view: kept for it meanwhile, it try agrees(a, back); } +test "a client joined from a dump moves through another view's pane as the session does, its lines not wrapped" { + const gpa = std.testing.allocator; + const a = try Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "build.zig" }, TestHost.host(), false); + defer a.deinit(); + // The first client's Wrap off (SPC t w), and its cursor down into the + // file's long lines, near the bottom of its view. + var buf: [256]u8 = undefined; + var seq: u32 = 1; + const before = [_]pardes.Event{.{ .command = "Wrap" }} ++ + @as([10]pardes.Event, @splat(.{ .key = .{ .cp = 'd', .ctrl = true } })) ++ + @as([15]pardes.Event, @splat(.{ .key = .{ .cp = 'j', .text = "j" } })); + for (before) |ev| { + _ = try a.take(try inputOf(&buf, 1, seq, ev)); + seq += 1; + } + // Another client joins, its view not live; the first's keys go on. + _ = try a.openView(2); + const joiner = try joinedNow(a, 3, 1); + defer joiner.deinit(); + try std.testing.expectEqual(digestOf(a), joiner.digest()); + for (0..3) |_| { + const u = try gpa.dupe(u8, try a.take(try inputOf(&buf, 1, seq, .{ .key = .{ .cp = 'd', .ctrl = true } }))); + defer gpa.free(u); + seq += 1; + joiner.confirm(u); + try agrees(a, joiner); + } +} + /// An input of a replica's in the session's order, as `Peers.input` takes /// it: the terminals flushed to every peer, the step, the rows it read that /// each peer holds as holes (`fill`), then its unit to every replica. |
