summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/edit.zig15
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 {