summaryrefslogtreecommitdiff
path: root/src/ninep
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 00:31:38 -0300
committerGabriel Schneider <[email protected]>2026-11-05 01:02:28 -0300
commit7d359addc420eca66bd1583d8fd8d6a104986a03 (patch)
tree2b8991a9a4e5b9c16a2b7683018d60c7c6985c1e /src/ninep
parent96cabca7ebe287692ebdff0dba6bb2897eba9d3e (diff)
downloadpardes-7d359addc420eca66bd1583d8fd8d6a104986a03.tar.gz
pardes-7d359addc420eca66bd1583d8fd8d6a104986a03.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/ninep')
-rw-r--r--src/ninep/ctl.zig2
-rw-r--r--src/ninep/pane.zig2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index a1504acb..d075e24e 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -441,7 +441,7 @@ pub fn paneText(p: *Pardes, pane: *Pane, buf: []u8) []const u8 {
// Then what its tag does not say: Collapse, and a PDF's PdfFit and
// PdfTint, in the words they take.
if (pane.collapsed) w.writeAll("collapsed ") catch {};
- if (comptime pardes.pdf_enabled) if (pane.pdf) |*pv| w.print("fit:{s} tint:{s} ", .{ @tagName(pv.fit), @tagName(pv.tint) }) catch {};
+ if (comptime pardes.pdf_enabled) if (pane.pdf) |pv| w.print("fit:{s} tint:{s} ", .{ @tagName(pv.fit), @tagName(pv.tint) }) catch {};
// Last, the body's mode, which the tag shows as a box: helix's select
// is normal mode extending.
w.print("mode:{s} ", .{if (pane.body.mode == .normal and pane.body.select) "select" else @tagName(pane.body.mode)}) catch {};
diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig
index 3895414b..df0c7975 100644
--- a/src/ninep/pane.zig
+++ b/src/ninep/pane.zig
@@ -461,7 +461,7 @@ fn readFlag(p: *Pardes, req: Req, on: bool) Reply {
/// with the page), null for any other pane.
fn pdfText(p: *Pardes, pane: *Pane) ?[]const u8 {
if (comptime !pardes.pdf_enabled) return null;
- const pv = &(pane.pdf orelse return null);
+ const pv = pane.pdf orelse return null;
return pv.ensureText(p.pdf_gpa);
}