From 7d359addc420eca66bd1583d8fd8d6a104986a03 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 00:31:38 -0300 Subject: panes: a pane's PDF state is its own allocation, `pdf: ?*Pdf.State` (made by openPane with pdf_gpa, freed by deinitPane), as a terminal's is, where every Pane held the State inline, a text file's and a terminal's too: a Pane is 49232 bytes where it was 88936 (the State 39704), and a replica's rollback copy of a pane without a PDF is that much smaller; the dump and the wire change with it, the walk writing the slot as a pointer to a State where it wrote the State in place, so a dump written before this, or a peer of an older build, gives its PDF panes no PDF (the walk notes `Pane.pdf: its kind changed; its default taken`, and dump.ensureKind makes each a terminal); the 97 uses change form only (a `|*x|` capture or a `&` dropped, normal.zig's one among them), applyNormal untouched Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/builtins.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/builtins.zig') diff --git a/src/builtins.zig b/src/builtins.zig index 95a6c692..1afba918 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -983,7 +983,7 @@ pub const PdfFit = struct { pub const enabled = pardes.pdf_enabled; pub const takes_arg = true; pub fn run(c: Ctx) void { - const state = &(c.pane.pdf orelse return); + const state = c.pane.pdf orelse return; if (c.arg != null) { const want = stateArg(c, panes.Pdf.FitMode, "PdfFit", "width or height") orelse return; if (want == state.fit) return; @@ -999,7 +999,7 @@ pub const PdfTint = struct { pub const enabled = pardes.pdf_enabled; pub const takes_arg = true; pub fn run(c: Ctx) void { - const state = &(c.pane.pdf orelse return); + const state = c.pane.pdf orelse return; if (c.arg != null) { const want = stateArg(c, panes.Pdf.TintMode, "PdfTint", "disabled, filtered or full") orelse return; while (state.tint != want) panes.Pdf.toggleTint(c.pane); -- cgit v1.3