diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2018-01-30 22:35:33 +0100 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2018-01-31 11:37:05 +0100 |
| commit | 6452831cf985bd31d16eb5a04b345038f45d203f (patch) | |
| tree | fa2fd5c857891b078e2d0debc73ae9e0a56d45b6 /runtime/autoload/provider | |
| parent | 649123d07c13d3314b7f97abdd3d8094b32fbefe (diff) | |
| download | rneovim-6452831cf985bd31d16eb5a04b345038f45d203f.tar.gz rneovim-6452831cf985bd31d16eb5a04b345038f45d203f.tar.bz2 rneovim-6452831cf985bd31d16eb5a04b345038f45d203f.zip | |
clipboard: macOS: fallback to tmux if pbcopy is broken #7940
On some versions of macOS, pbcopy doesn't work in tmux <2.6
https://superuser.com/q/231130
Fallback to tmux in that case.
Add a healthcheck for this scenario.
Diffstat (limited to 'runtime/autoload/provider')
| -rw-r--r-- | runtime/autoload/provider/clipboard.vim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index e5a6e4748a..9e2e6046f8 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -26,7 +26,7 @@ let s:selections = { '*': s:selection, '+': copy(s:selection) } function! s:try_cmd(cmd, ...) abort let argv = split(a:cmd, " ") - let out = a:0 ? systemlist(argv, a:1, 1) : systemlist(argv, [''], 1) + let out = systemlist(argv, (a:0 ? a:1 : ['']), 1) if v:shell_error if !exists('s:did_error_try_cmd') echohl WarningMsg @@ -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') + elseif has('mac') && executable('pbcopy') && s:cmd_ok('pbcopy') let s:copy['+'] = 'pbcopy' let s:paste['+'] = 'pbpaste' let s:copy['*'] = s:copy['+'] |