summaryrefslogtreecommitdiff
path: root/src/macos.zig
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/macos.zig
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/macos.zig')
-rw-r--r--src/macos.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/macos.zig b/src/macos.zig
index 60f9e00e..af8410e0 100644
--- a/src/macos.zig
+++ b/src/macos.zig
@@ -880,7 +880,7 @@ fn watchInitialGeneration(st: *State, pane: u8, path: []const u8) ?file_watch.Ge
const value = st.core.panes[pane] orelse return null;
if (value.file) |file| if (std.mem.eql(u8, file.path, path))
return .{ .text = std.hash.Wyhash.hash(0, file.content) };
- if (comptime pardes.pdf_enabled) if (value.pdf) |*pdf| if (std.mem.eql(u8, pdf.path, path))
+ if (comptime pardes.pdf_enabled) if (value.pdf) |pdf| if (std.mem.eql(u8, pdf.path, path))
return .{ .pdf = null };
return null;
}
@@ -998,7 +998,7 @@ fn reloadWatchedFile(st: *State, pane: u8, announce: bool) bool {
},
.pdf => |old_identity| pdf: {
if (comptime !pardes.pdf_enabled) break :pdf .no_change;
- const state_before = if (current.pdf) |*pdf_before| pdf_before else break :pdf .no_change;
+ const state_before = if (current.pdf) |pdf_before| pdf_before else break :pdf .no_change;
if (!std.mem.eql(u8, state_before.path, watched.path)) break :pdf .no_change;
const before = file_watch.identify(st.io, watched.path) catch {
retryWatchedFile(st, pane, generation);
@@ -1012,7 +1012,7 @@ fn reloadWatchedFile(st: *State, pane: u8, announce: bool) bool {
const after = st.core.panes[pane] orelse break :pdf .changed_uncommitted;
if (after.serial != watched.serial) break :pdf .changed_uncommitted;
- const pdf_state = if (after.pdf) |*pdf_after| pdf_after else break :pdf .changed_uncommitted;
+ const pdf_state = if (after.pdf) |pdf_after| pdf_after else break :pdf .changed_uncommitted;
if (!std.mem.eql(u8, pdf_state.path, watched.path)) break :pdf .changed_uncommitted;
const after_identity = file_watch.identify(st.io, watched.path) catch {
retryWatchedFile(st, pane, generation);