From 467fad51b1a604515f0add44e0675105ae393f79 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Wed, 20 Nov 2024 18:09:01 -0500 Subject: [PATCH] clipboard: Sway builtin provider yank and paste commands The configuration here is not super intuitive - in order to yank from a clipboard provider we want it to paste the clipboard and in order to paste to the clipboard we want it to yank the contents we pass. This swaps the programs for yank and paste to align with that. Ref #10839 --- helix-view/src/clipboard.rs | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/helix-view/src/clipboard.rs b/helix-view/src/clipboard.rs index cd8a4eeb5..5e16461e0 100644 --- a/helix-view/src/clipboard.rs +++ b/helix-view/src/clipboard.rs @@ -359,44 +359,44 @@ macro_rules! command_provider { command_provider! { TMUX, - yank => "tmux", "load-buffer", "-w", "-"; - paste => "tmux", "save-buffer", "-"; + yank => "tmux", "save-buffer", "-"; + paste => "tmux", "load-buffer", "-w", "-"; } command_provider! { PASTEBOARD, - yank => "pbcopy"; - paste => "pbpaste"; + yank => "pbpaste"; + paste => "pbcopy"; } command_provider! { WL_CLIPBOARD, - yank => "wl-copy", "--type", "text/plain"; - paste => "wl-paste", "--no-newline"; - yank_primary => "wl-copy", "-p", "--type", "text/plain"; - paste_primary => "wl-paste", "-p", "--no-newline"; + yank => "wl-paste", "--no-newline"; + paste => "wl-copy", "--type", "text/plain"; + yank_primary => "wl-paste", "-p", "--no-newline"; + paste_primary => "wl-copy", "-p", "--type", "text/plain"; } command_provider! { XCLIP, - yank => "xclip", "-i", "-selection", "clipboard"; - paste => "xclip", "-o", "-selection", "clipboard"; - yank_primary => "xclip", "-i"; - paste_primary => "xclip", "-o"; + yank => "xclip", "-o", "-selection", "clipboard"; + paste => "xclip", "-i", "-selection", "clipboard"; + yank_primary => "xclip", "-o"; + paste_primary => "xclip", "-i"; } command_provider! { XSEL, - yank => "xsel", "-i", "-b"; - paste => "xsel", "-o", "-b"; - yank_primary => "xsel", "-i"; - paste_primary => "xsel", "-o"; + yank => "xsel", "-o", "-b"; + paste => "xsel", "-i", "-b"; + yank_primary => "xsel", "-o"; + paste_primary => "xsel", "-i"; } command_provider! { WIN32, - yank => "win32yank.exe", "-i", "--crlf"; - paste => "win32yank.exe", "-o", "--lf"; + yank => "win32yank.exe", "-o", "--lf"; + paste => "win32yank.exe", "-i", "--crlf"; } command_provider! { TERMUX, - yank => "termux-clipboard-set"; - paste => "termux-clipboard-get"; + yank => "termux-clipboard-get"; + paste => "termux-clipboard-set"; } #[cfg(feature = "term")]