From aac802c58937053a200b0392843195b128a21172 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 4 Nov 2026 23:55:35 -0300 Subject: pdf: every by-value copy of a pane's PDF state (about 39 KB, its 256 raster slots) taken to read a field or two is a pointer capture, in panes, edit, mouse, tagline, look, exec, the core, 9P ctl, fs, draw, macos and the sections bench; the hot one is pdf_view.moving, which Pardes.continuous asks on every pass of the shell loop and which copied every PDF pane's state each time Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/exec.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/exec.zig') diff --git a/src/exec.zig b/src/exec.zig index 4706d11a..27effda0 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -277,7 +277,7 @@ fn heldPane(p: *Pardes, first: usize, k: usize) ?*Pane { pub fn heldSelection(p: *Pardes, first: usize) ?[]const u8 { for (0..p.panes.len + 2) |k| { const t = heldPane(p, first, k) orelse continue; - if (comptime pdf_enabled) if (p.native_images) if (t.pdf) |pv| { + if (comptime pdf_enabled) if (p.native_images) if (t.pdf) |*pv| { if (pv.selection != null and pv.selection_text.len > 0) return pv.selection_text; }; -- cgit v1.3