From 3a802e3c16d2a06f455fb45901ffa6954098f853 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Sat, 29 Oct 2016 14:35:15 +0200 Subject: provider/clipboard.vim: never show a warning on sourcing Never throw an error when provider/clipboard.vim is sourced for the first time. Save the error instead and expose it via `provider#clipboard#Error()`, mimicking provider/python.vim. --- runtime/autoload/provider/clipboard.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'runtime/autoload') diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index 7a977c391e..f63ad5730b 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -31,6 +31,11 @@ function! s:try_cmd(cmd, ...) endfunction let s:cache_enabled = 1 +let s:err = '' + +function! provider#clipboard#Error() abort + return s:err +endfunction function! provider#clipboard#Executable() abort if executable('pbcopy') @@ -66,11 +71,11 @@ function! provider#clipboard#Executable() abort return 'doitclient' endif + let s:err = 'clipboard: No clipboard tool available. See :help clipboard' return '' endfunction if empty(provider#clipboard#Executable()) - echom 'clipboard: No clipboard tool available. See :help clipboard' finish endif -- cgit