mirror of
https://github.com/junegunn/vim-plug.git
synced 2025-12-10 10:51:50 +08:00
Make plug#begin() return boolean value
silent! if plug#begin() Plug 'user/repo' .. call plug#end() endif
This commit is contained in:
6
plug.vim
6
plug.vim
@@ -65,12 +65,12 @@ function! plug#begin(...)
|
|||||||
call mkdir(home, 'p')
|
call mkdir(home, 'p')
|
||||||
catch
|
catch
|
||||||
echoerr 'Invalid plug directory: '. home
|
echoerr 'Invalid plug directory: '. home
|
||||||
return
|
return 0
|
||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
if !executable('git')
|
if !executable('git')
|
||||||
echoerr "`git' executable not found. vim-plug requires git."
|
echoerr "`git' executable not found. vim-plug requires git."
|
||||||
return
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let g:plug_home = home
|
let g:plug_home = home
|
||||||
@@ -82,6 +82,8 @@ function! plug#begin(...)
|
|||||||
command! -nargs=0 -bang PlugClean call s:clean('<bang>' == '!')
|
command! -nargs=0 -bang PlugClean call s:clean('<bang>' == '!')
|
||||||
command! -nargs=0 PlugUpgrade if s:upgrade() | execute "source ". s:me | endif
|
command! -nargs=0 PlugUpgrade if s:upgrade() | execute "source ". s:me | endif
|
||||||
command! -nargs=0 PlugStatus call s:status()
|
command! -nargs=0 PlugStatus call s:status()
|
||||||
|
|
||||||
|
return 1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! plug#end()
|
function! plug#end()
|
||||||
|
|||||||
Reference in New Issue
Block a user