mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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.
This commit is contained in:
parent
797d72a997
commit
3a802e3c16
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user