mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(clipboard): prefer xsel #20918
Problem: xclip is not actively maintained compared to xsel, and it has a bug: $ touch a $ xsel -ib < a $ xsel -ob $ xclip -o -selection clipboard Error: target STRING not available Years ago, the situation was reversed. We originally preferred xsel46bd3c0f77
but then swapped to xclip799d9c3215
to work around https://github.com/neovim/neovim/issues/7237#issuecomment-443440633 Solution: Prefer xsel again. close #20862 ref #9302 ref https://github.com/astrand/xclip/issues/38
This commit is contained in:
parent
d337814906
commit
b042f6d902
@ -97,18 +97,18 @@ function! provider#clipboard#Executable() abort
|
|||||||
let s:copy['*'] = ['wl-copy', '--foreground', '--primary', '--type', 'text/plain']
|
let s:copy['*'] = ['wl-copy', '--foreground', '--primary', '--type', 'text/plain']
|
||||||
let s:paste['*'] = ['wl-paste', '--no-newline', '--primary']
|
let s:paste['*'] = ['wl-paste', '--no-newline', '--primary']
|
||||||
return 'wl-copy'
|
return 'wl-copy'
|
||||||
elseif !empty($DISPLAY) && executable('xclip')
|
|
||||||
let s:copy['+'] = ['xclip', '-quiet', '-i', '-selection', 'clipboard']
|
|
||||||
let s:paste['+'] = ['xclip', '-o', '-selection', 'clipboard']
|
|
||||||
let s:copy['*'] = ['xclip', '-quiet', '-i', '-selection', 'primary']
|
|
||||||
let s:paste['*'] = ['xclip', '-o', '-selection', 'primary']
|
|
||||||
return 'xclip'
|
|
||||||
elseif !empty($DISPLAY) && executable('xsel') && s:cmd_ok('xsel -o -b')
|
elseif !empty($DISPLAY) && executable('xsel') && s:cmd_ok('xsel -o -b')
|
||||||
let s:copy['+'] = ['xsel', '--nodetach', '-i', '-b']
|
let s:copy['+'] = ['xsel', '--nodetach', '-i', '-b']
|
||||||
let s:paste['+'] = ['xsel', '-o', '-b']
|
let s:paste['+'] = ['xsel', '-o', '-b']
|
||||||
let s:copy['*'] = ['xsel', '--nodetach', '-i', '-p']
|
let s:copy['*'] = ['xsel', '--nodetach', '-i', '-p']
|
||||||
let s:paste['*'] = ['xsel', '-o', '-p']
|
let s:paste['*'] = ['xsel', '-o', '-p']
|
||||||
return 'xsel'
|
return 'xsel'
|
||||||
|
elseif !empty($DISPLAY) && executable('xclip')
|
||||||
|
let s:copy['+'] = ['xclip', '-quiet', '-i', '-selection', 'clipboard']
|
||||||
|
let s:paste['+'] = ['xclip', '-o', '-selection', 'clipboard']
|
||||||
|
let s:copy['*'] = ['xclip', '-quiet', '-i', '-selection', 'primary']
|
||||||
|
let s:paste['*'] = ['xclip', '-o', '-selection', 'primary']
|
||||||
|
return 'xclip'
|
||||||
elseif executable('lemonade')
|
elseif executable('lemonade')
|
||||||
let s:copy['+'] = ['lemonade', 'copy']
|
let s:copy['+'] = ['lemonade', 'copy']
|
||||||
let s:paste['+'] = ['lemonade', 'paste']
|
let s:paste['+'] = ['lemonade', 'paste']
|
||||||
|
Loading…
Reference in New Issue
Block a user