commit 3a35fdc3471e5f8fb6ad57b48abaa4e4db006de3
parent a87aa68ed0e79389ba2e0b94a727f69303c62b71
Author: Fredrik Foss-Indrehus <fredrikfoss@fr.urbanpets.no>
Date: Mon, 19 May 2025 01:44:13 +0200
feat(clipboard): wayclip primary clipboard and correct mimetype (#33990)
* Don't specify wayclip mimetype
Problem: Since wayclip 0.2, wayclip assumes UTF-8
(text/plain;charset=utf-8) in absence of an explicit mimetype.
Since Neovim sets the mimetype to "text/plain" without
specifying UTF-8, you will also have to use `-t text/plain`
when using waypaste or wayclip outside of Neovim.
Solution: Don't specify mimetype when using wayclip, thereby using the
default "text/plain:charset=utf-8".
* Add primary clipboard support to wayclip
wayclip have had support for primary clipboard for some time now.
---------
Co-authored-by: Fredrik Foss-Indrehus <fred@ffoss.net>
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
@@ -85,10 +85,10 @@ function! s:set_wayland() abort
endfunction
function! s:set_wayclip() abort
- let s:copy['+'] = ['waycopy', '-t', 'text/plain']
- let s:paste['+'] = ['waypaste', '-t', 'text/plain']
- let s:copy['*'] = s:copy['+']
- let s:paste['*'] = s:paste['+']
+ let s:copy['+'] = ['waycopy']
+ let s:paste['+'] = ['waypaste']
+ let s:copy['*'] = ['waycopy', '-p']
+ let s:paste['*'] = ['waypaste', '-p']
return 'wayclip'
endfunction