diff options
Diffstat (limited to 'src/replica.zig')
| -rw-r--r-- | src/replica.zig | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/replica.zig b/src/replica.zig index 6de125bd..40353d89 100644 --- a/src/replica.zig +++ b/src/replica.zig @@ -437,7 +437,7 @@ pub const Screens = struct { pp.shadow.deinit(x.s.gpa); pp.shadow.serial = pane.serial; } - const r = p.rects[id]; + const r = p.view().rects[id]; const cols = r.w -| pardes.config.GUTTER; const rows = (r.h -| pane.tag_rows) -| pane.notices.span(); if (cols == 0 or rows == 0) continue; @@ -990,7 +990,7 @@ pub const Replica = struct { // and applied again over each delta while it waits (`screen`), so // what the authority's unit confirms read the emulator its step // read (the deltas come before it). - const keyboard = if (c.panes[c.active]) |pane| pane.terminal != null else false; + const keyboard = if (c.panes[c.view().active]) |pane| pane.terminal != null else false; c.update(in.event); c.step(); p.terminal = r.t.screen_state and (keyboard or r.t.touched); @@ -3087,7 +3087,7 @@ test "a delta applied under a speculation outlives its rollback: the terminal st } else return error.NoShell; // Typing goes to the text pane under the shell (the host's write of // `active`, taped). - a.core.active = for (a.core.panes, 0..) |slot, id| { + a.core.view().active = for (a.core.panes, 0..) |slot, id| { if (slot) |pane| if (pane.file != null) break id; } else return error.NoTextPane; r.confirm(try a.local(.{ .focus = true })); @@ -3170,7 +3170,7 @@ test "a closed terminal brought back on a screen-state replica: its emulator on const shell: u8 = for (a.core.panes, 0..) |slot, id| { if (slot) |pane| if (pane.isTerminal()) break @intCast(id); } else return error.NoShell; - a.core.active = shell; + a.core.view().active = shell; r.confirm(try a.local(.{ .command = "Del" })); try std.testing.expectEqual(@as(usize, 1), a.core.store.closed.items.len); var line: [32]u8 = undefined; @@ -3195,7 +3195,7 @@ test "a view that sized a terminal closing leaves nothing queued: the others' re defer r1.deinit(); const r2 = try Replica.init(gpa, 2, first, true); defer r2.deinit(); - a.core.active = for (a.core.panes, 0..) |slot, id| { + a.core.view().active = for (a.core.panes, 0..) |slot, id| { if (slot) |pane| if (pane.isTerminal()) break id; } else return error.NoShell; const opened = try a.openView(2); @@ -3243,7 +3243,7 @@ test "a terminal sized again by a client's key: the step reads the grid it had, const shell: u8 = for (a.core.panes, 0..) |slot, id| { if (slot) |pane| if (pane.isTerminal()) break @intCast(id); } else return error.NoShell; - a.core.active = shell; + a.core.view().active = shell; // History the replica holds as holes, of lines a narrow grid wraps in // two, which a wider one unwraps. var line: [96]u8 = undefined; @@ -3345,7 +3345,7 @@ test "pardes's own keys over a terminal's history apply at once: its view moves const shell: u8 = for (a.core.panes, 0..) |slot, id| { if (slot) |pane| if (pane.isTerminal()) break @intCast(id); } else return error.NoShell; - a.core.active = shell; + a.core.view().active = shell; r.confirm(try a.local(.{ .focus = true })); var line: [64]u8 = undefined; for (0..200) |i| a.output(.{ .output = .{ .pane = shell, .bytes = try std.fmt.bufPrint(&line, "history line {d}\r\n", .{i}) } }); @@ -3801,7 +3801,7 @@ test "a replica joined after a pane closed: the session's jump to it, its Panes _ = try a.local(.{ .command = try std.fmt.bufPrint(&line, "Look {s}/build.zig.zon", .{dir}) }); _ = try a.local(.{ .command = "Del" }); try std.testing.expectEqual(@as(usize, 1), a.core.store.closed.items.len); - try std.testing.expect(a.core.jumps.n > 1); + try std.testing.expect(a.core.view().jumps.n > 1); // What another window of the user's wrote to the store, which the // session read (src/variants_test.zig's case, the variant hunt's). a.core.recent.opened(a.core.recentGpa(), try std.fmt.bufPrint(&line, "{s}/build.zig", .{dir})); @@ -3928,7 +3928,7 @@ test "a client that diverged joins again for its view: kept for it meanwhile, it old.confirm(opened.unit); var buf: [256]u8 = undefined; old.confirm(try a.take(try inputOf(&buf, 2, 1, .{ .command = "New" }))); - const made = a.core.active; + const made = a.core.view().active; // Its bye says it joins again: its view is kept, as every replica keeps it. var was = Stepping.begin(&a.t, null); a.core.awayView(opened.view); @@ -3948,7 +3948,7 @@ test "a client that diverged joins again for its view: kept for it meanwhile, it defer gpa.free(u); old.confirm(u); back.confirm(u); - try std.testing.expectEqual(made, a.core.active); + try std.testing.expectEqual(made, a.core.view().active); try std.testing.expect(pardes.layout.findPane(a.core, made) != null); try agrees(a, old); try agrees(a, back); @@ -4055,7 +4055,7 @@ test "a step that reads a terminal's rows as the core keeps them sends a new cli const shell: u8 = for (a.core.panes, 0..) |slot, id| { if (slot) |pane| if (pane.isTerminal()) break @intCast(id); } else return error.NoShell; - a.core.active = shell; + a.core.view().active = shell; var line: [64]u8 = undefined; for (0..60) |i| a.output(.{ .output = .{ .pane = shell, .bytes = try std.fmt.bufPrint(&line, "line {d} of the shell's history\r\n", .{i}) } }); const out = try gpa.dupe(u8, (try a.pending()).?); |
