mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
macOS: Use pbpaste
to detect a working clipboard (#7983)
`pbcopy` writes to the clipboard, it should not be used to sanity-check the clipboard.
This commit is contained in:
parent
f66ebcd0a2
commit
dc53629587
@ -126,7 +126,7 @@ endfunction
|
||||
function! s:check_clipboard() abort
|
||||
call health#report_start('Clipboard (optional)')
|
||||
|
||||
if !empty($TMUX) && executable('tmux') && executable('pbcopy') && !s:cmd_ok('pbcopy')
|
||||
if !empty($TMUX) && executable('tmux') && executable('pbpaste') && !s:cmd_ok('pbpaste')
|
||||
let tmux_version = matchstr(system('tmux -V'), '\d\+\.\d\+')
|
||||
call health#report_error('pbcopy does not work with tmux version: '.tmux_version,
|
||||
\ ['Install tmux 2.6+. https://superuser.com/q/231130',
|
||||
|
@ -64,7 +64,7 @@ function! provider#clipboard#Executable() abort
|
||||
let s:paste = get(g:clipboard, 'paste', { '+': v:null, '*': v:null })
|
||||
let s:cache_enabled = get(g:clipboard, 'cache_enabled', 0)
|
||||
return get(g:clipboard, 'name', 'g:clipboard')
|
||||
elseif has('mac') && executable('pbcopy') && s:cmd_ok('pbcopy')
|
||||
elseif has('mac') && executable('pbpaste') && s:cmd_ok('pbpaste')
|
||||
let s:copy['+'] = 'pbcopy'
|
||||
let s:paste['+'] = 'pbpaste'
|
||||
let s:copy['*'] = s:copy['+']
|
||||
|
Loading…
Reference in New Issue
Block a user