From 3fcfd524226f0d41fa5b4eec870a8a2f9767044d Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Tue, 9 Jun 2015 22:05:52 +0200 Subject: clipboard: avoid redundant error message on `clipboard_get` failure . Fixes #2712 Helped-By: Michael Reed --- runtime/autoload/provider/clipboard.vim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index d2388e92a8..d20b3a9bf1 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -22,14 +22,15 @@ function! s:try_cmd(cmd, ...) let argv = split(a:cmd, " ") let out = a:0 ? systemlist(argv, a:1, 1) : systemlist(argv, [''], 1) if v:shell_error + echohl WarningMsg echo "clipboard: error: ".(len(out) ? out[0] : '') - return '' + echohl None + return 0 endif return out endfunction let s:cache_enabled = 1 - if executable('pbcopy') let s:copy['+'] = 'pbcopy' let s:paste['+'] = 'pbpaste' @@ -47,7 +48,7 @@ elseif executable('xsel') let s:copy['*'] = 'xsel --nodetach -i -p' let s:paste['*'] = 'xsel -o -p' else - echom 'clipboard: No shell command for communicating with the clipboard found.' + echom 'clipboard: No clipboard tool available. See :help nvim-clipboard' finish endif -- cgit