mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00: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:
@@ -31,6 +31,11 @@ function! s:try_cmd(cmd, ...)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let s:cache_enabled = 1
|
let s:cache_enabled = 1
|
||||||
|
let s:err = ''
|
||||||
|
|
||||||
|
function! provider#clipboard#Error() abort
|
||||||
|
return s:err
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! provider#clipboard#Executable() abort
|
function! provider#clipboard#Executable() abort
|
||||||
if executable('pbcopy')
|
if executable('pbcopy')
|
||||||
@@ -66,11 +71,11 @@ function! provider#clipboard#Executable() abort
|
|||||||
return 'doitclient'
|
return 'doitclient'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let s:err = 'clipboard: No clipboard tool available. See :help clipboard'
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
if empty(provider#clipboard#Executable())
|
if empty(provider#clipboard#Executable())
|
||||||
echom 'clipboard: No clipboard tool available. See :help clipboard'
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user