From f756f031fa7262c4e92589dfad35280327391cfa Mon Sep 17 00:00:00 2001 From: jiqb Date: Thu, 31 Mar 2022 09:52:19 -0700 Subject: [PATCH 1/2] feat(clipboard): reintroduce win32yank for wsl2 linux --- helix-view/src/clipboard.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/helix-view/src/clipboard.rs b/helix-view/src/clipboard.rs index c213827ee1ea..8880361c2864 100644 --- a/helix-view/src/clipboard.rs +++ b/helix-view/src/clipboard.rs @@ -88,6 +88,11 @@ pub fn get_clipboard_provider() -> Box { primary_paste => "wl-paste", "-p", "--no-newline"; primary_copy => "wl-copy", "-p", "--type", "text/plain"; } + } else if exists("win32yank.exe") { + command_provider! { + paste => "win32yank.exe", "-o", "--lf"; + copy => "win32yank.exe", "-i", "--crlf"; + } } else if env_var_is_set("DISPLAY") && exists("xclip") { command_provider! { paste => "xclip", "-o", "-selection", "clipboard"; From e0d4ec43cca37a29bf1ecc89f48a8352788e8215 Mon Sep 17 00:00:00 2001 From: jiqb Date: Thu, 31 Mar 2022 19:20:57 -0700 Subject: [PATCH 2/2] refactor(clipboard): adjust win32yank position to not interrupt wayland/x11 --- helix-view/src/clipboard.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/helix-view/src/clipboard.rs b/helix-view/src/clipboard.rs index 8880361c2864..5cc5cad8938a 100644 --- a/helix-view/src/clipboard.rs +++ b/helix-view/src/clipboard.rs @@ -88,11 +88,6 @@ pub fn get_clipboard_provider() -> Box { primary_paste => "wl-paste", "-p", "--no-newline"; primary_copy => "wl-copy", "-p", "--type", "text/plain"; } - } else if exists("win32yank.exe") { - command_provider! { - paste => "win32yank.exe", "-o", "--lf"; - copy => "win32yank.exe", "-i", "--crlf"; - } } else if env_var_is_set("DISPLAY") && exists("xclip") { command_provider! { paste => "xclip", "-o", "-selection", "clipboard"; @@ -109,6 +104,11 @@ pub fn get_clipboard_provider() -> Box { primary_paste => "xsel", "-o"; primary_copy => "xsel", "-i"; } + } else if exists("win32yank.exe") { + command_provider! { + paste => "win32yank.exe", "-o", "--lf"; + copy => "win32yank.exe", "-i", "--crlf"; + } } else if exists("termux-clipboard-set") && exists("termux-clipboard-get") { command_provider! { paste => "termux-clipboard-get";