summaryrefslogtreecommitdiff
path: root/src/edit.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 23:55:35 -0300
committerGabriel Schneider <[email protected]>2026-11-05 01:02:08 -0300
commitaac802c58937053a200b0392843195b128a21172 (patch)
tree67ea31d4f5be6eb5b8ef8ea9ef301e3874b1cebd /src/edit.zig
parent7fb385cb7882f79bd448250b176f2d3a81de64f6 (diff)
downloadpardes-aac802c58937053a200b0392843195b128a21172.tar.gz
pardes-aac802c58937053a200b0392843195b128a21172.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/edit.zig')
-rw-r--r--src/edit.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/edit.zig b/src/edit.zig
index 74dd0d1d..85ace33f 100644
--- a/src/edit.zig
+++ b/src/edit.zig
@@ -182,7 +182,7 @@ fn pasteInto(p: *Pardes, t: *Text, bytes: []const u8) void {
}
pub fn clipYank(p: *Pardes, pane: *Pane, main_only: bool) void {
- if (comptime pdf_enabled) if (pane.pdf) |pv| {
+ if (comptime pdf_enabled) if (pane.pdf) |*pv| {
if (pv.selection_text.len > 0) setClipboard(p, pv.selection_text);
return;
};
@@ -360,7 +360,7 @@ pub fn spanHas(r: i32, c: i32, ar: i32, ac: i32, br: i32, bc: i32) bool {
/// the active modal selection as text (v range or x lines), if any
pub fn currentSelText(p: *Pardes, pane: *Pane) ?[]const u8 {
- if (comptime pdf_enabled) if (p.native_images) if (pane.pdf) |pv|
+ if (comptime pdf_enabled) if (p.native_images) if (pane.pdf) |*pv|
if (pv.selection != null and pv.selection_text.len > 0) return pv.selection_text;
if (pane.body.vsel.active) return vselText(p, &pane.body);
if (!pane.body.msel.active) return null;