diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-04 23:27:11 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 01:16:28 -0300 |
| commit | abeccae181403d8db145a3c5f72c77648d325b53 (patch) | |
| tree | 269c7d2e4ce0e91520bf4c09d7ef5628fa7c404e /src/edit.zig | |
| parent | b175d50a3b7f8434ef087536af5c32e97e2b4f0b (diff) | |
| download | pardes-abeccae181403d8db145a3c5f72c77648d325b53.tar.gz pardes-abeccae181403d8db145a3c5f72c77648d325b53.zip | |
edit: setClipboard, with one caller, goes: clipYank names the + register first and its PDF branch yanks into it
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.zig | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/edit.zig b/src/edit.zig index 72cfe31a..a7449dcf 100644 --- a/src/edit.zig +++ b/src/edit.zig @@ -46,13 +46,6 @@ pub fn setYank(p: *Pardes, text: []const u8) void { if (name == '+' and (one or p.multi_first)) p.emit(.{ .set_clipboard = {} }); } -pub fn setClipboard(p: *Pardes, text: []const u8) void { - const named = p.register; - p.register = '+'; - defer p.register = named; - setYank(p, text); -} - /// Value `i` of register `name` as the command at range `i` reads it, the /// computed registers included: `#` is the range's number from 1, `.` its /// text, `%` the file's name, `_` nothing. Scratch- or register-owned. @@ -182,14 +175,14 @@ 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 (pv.selection_text.len > 0) setClipboard(p, pv.selection_text); - return; - }; // helix's `"+y`: the clipboard register, and only it const named = p.register; p.register = '+'; defer p.register = named; + if (comptime pdf_enabled) if (pane.pdf) |pv| { + if (pv.selection_text.len > 0) setYank(p, pv.selection_text); + return; + }; if (pane.body.nsel > 0 and !main_only) { normal.replaySels(p, &pane.body, .{ .normal = .{ .edit = .{ .kind = .yank, .count = 1 } } }); } else { |
