aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Hinz <mh.codebro+github@gmail.com>2018-02-08 00:27:54 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-02-08 00:27:54 +0100
commitdc536295875640ef5d7b28d8135d0ef72d782d5e (patch)
tree71b453d05a951c0d132d00e9e93164bef3a0d234
parentf66ebcd0a2d374f5516236ad6641aa022ce29b7a (diff)
downloadrneovim-dc536295875640ef5d7b28d8135d0ef72d782d5e.tar.gz
rneovim-dc536295875640ef5d7b28d8135d0ef72d782d5e.tar.bz2
rneovim-dc536295875640ef5d7b28d8135d0ef72d782d5e.zip
macOS: Use `pbpaste` to detect a working clipboard (#7983)
`pbcopy` writes to the clipboard, it should not be used to sanity-check the clipboard.
-rw-r--r--runtime/autoload/health/provider.vim2
-rw-r--r--runtime/autoload/provider/clipboard.vim2
2 files changed, 2 insertions, 2 deletions
diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim
index ae106095f9..073dcf92a8 100644
--- a/runtime/autoload/health/provider.vim
+++ b/runtime/autoload/health/provider.vim
@@ -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',
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
index 9e2e6046f8..87a0315073 100644
--- a/runtime/autoload/provider/clipboard.vim
+++ b/runtime/autoload/provider/clipboard.vim
@@ -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['+']