summaryrefslogtreecommitdiff
path: root/core/views.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-22 16:50:34 -0300
committerGabriel Schneider <[email protected]>2026-11-22 16:53:19 -0300
commit9863a63b614d200852853825031189364dcacfdc (patch)
treed235648a2ac14b3e311746ced3433ed6865e2061 /core/views.zig
parent6544f73a6b50e5ba68564beea7784593bb54348e (diff)
parentbad506bd45846e012246a33b5d3097b3e92f02bc (diff)
downloadpardes-9863a63b614d200852853825031189364dcacfdc.tar.gz
pardes-9863a63b614d200852853825031189364dcacfdc.zip
integration: the old road deleted and the emulator's boundary on the gathered line: pardes-merge56 (`qvwrwxtu`: the installed tree and the source view's changes to their last slice) and pardes-term-join-9 (`twssqzqw`, fourteen changes on pardes-merge55: every client's terminals by the pty's bytes and nothing else: the delta protocol, its flow control and core/term/screen_state.zig deleted (-3,605 +504 lines), the wire at 30, one soak; S1: abi/term.zig's Ops in replicated and local, the terminal's digest covering what a step reads, every call of the core's into a terminal listed with its rule as a test; a client's own join again judged after its goodbye; a pty's size one fact the core hands its host for every fork, adopt and resize; a closed view sizes no terminal); no textual conflict; one semantic one, resolved here: core/jj.zig's Churn test (the layers' last round) called Authority.init and Replica.init with the road's flag the deletion took away: the argument removed; core-test 916/1073 (157 skipped), shell-test 1115/1118; its gate: .scratch/sketch/reorg/merge57, the numbers in PARDES.md (2026-11-22)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/views.zig')
-rw-r--r--core/views.zig25
1 files changed, 23 insertions, 2 deletions
diff --git a/core/views.zig b/core/views.zig
index 704fc859..663610c3 100644
--- a/core/views.zig
+++ b/core/views.zig
@@ -423,6 +423,7 @@ pub fn closeKeeping(p: *Pardes, k: u8) void {
inline for (sized ++ laid_out) |name| @field(v, name) = @field(p.views[k].?, name);
v.jumps.force = force;
for (p.panes) |s| if (s) |pane| {
+ if (pane.sized_by == k) pane.sized_by = other;
if (pane.pv_known & bit(other) != 0 and pane.pv[other].body.sels.len > 0) p.gpa.free(pane.pv[other].body.sels);
pane.pv[other] = fresh(pane);
pane.pv_known |= bit(other);
@@ -447,8 +448,10 @@ fn dropView(p: *Pardes, k: u8) void {
}
pane.pv[k].body.sels = &.{};
pane.pv_known &= ~bit(k);
- // A name it was drafting goes with it.
+ // A name it was drafting goes with it; a terminal it sized keeps
+ // its size (Pardes.sizes), for no view that is not typed in.
if (pane.prompt == .name and pane.prompt_view == k) pane.closePrompt();
+ if (pane.sized_by == k) pane.sized_by = null;
};
p.views_open &= ~bit(k);
p.views_away &= ~bit(k);
@@ -700,10 +703,28 @@ test "a terminal shown at two sizes takes the size of the view that typed into i
try testing.expectEqual(big, .{ term.cols, term.rows });
p.update(.{ .key = .{ .cp = Key.right } });
try testing.expectEqual(small, .{ term.cols, term.rows });
- // That view gone, the one left sizes it.
+ // Its pty in pixels at the cell of the view that sizes it, whichever
+ // is live.
+ p.views[k.index()].?.cell_pixels = .{ .w = 10, .h = 20 };
+ p.update(.{ .key = .{ .cp = Key.right } });
+ p.toView(k);
+ p.update(.{ .key = .{ .cp = Key.right } });
+ p.toView(.at(0));
+ try testing.expectEqual(pardes.PtySize{ .cols = big[0], .rows = big[1], .w_px = big[0] * 10, .h_px = big[1] * 20 }, p.ptySize(.at(p.view().active), null));
+ p.update(.{ .key = .{ .cp = Key.right } });
+ try testing.expectEqual(pardes.PtySize{ .cols = small[0], .rows = small[1], .w_px = small[0] * 8, .h_px = small[1] * 16 }, p.ptySize(.at(p.view().active), null));
+ // That view gone, the size stays until the one left types into it; a
+ // view opened in its place sizes nothing it has not typed into.
p.toView(k);
p.closeView(.at(0));
try testing.expectEqual(k.index(), p.live);
+ try testing.expectEqual(small, .{ term.cols, term.rows });
+ const again = p.openView().?;
+ p.toView(again);
+ p.update(.{ .resize = .{ .cols = 100, .rows = 30 } });
+ try testing.expectEqual(small, .{ term.cols, term.rows });
+ p.toView(k);
+ p.update(.{ .key = .{ .cp = Key.right } });
try testing.expectEqual(big, .{ term.cols, term.rows });
}