mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 10:20:05 +08:00
fix(bootstrap): use timer for bootstrap_after
This commit is contained in:
parent
f725666783
commit
a974fb5646
@ -26,26 +26,22 @@ if has('nvim-0.10.0')
|
|||||||
call SpaceVim#logger#info('run root changed callback on VimEnter!')
|
call SpaceVim#logger#info('run root changed callback on VimEnter!')
|
||||||
call SpaceVim#plugins#projectmanager#RootchandgeCallback()
|
call SpaceVim#plugins#projectmanager#RootchandgeCallback()
|
||||||
if !empty(get(g:, '_spacevim_bootstrap_after', ''))
|
if !empty(get(g:, '_spacevim_bootstrap_after', ''))
|
||||||
try
|
function! s:bootstrap_after(...) abort
|
||||||
call call(g:_spacevim_bootstrap_after, [])
|
try
|
||||||
let g:_spacevim_bootstrap_after_success = 1
|
call call(g:_spacevim_bootstrap_after, [])
|
||||||
catch
|
let g:_spacevim_bootstrap_after_success = 1
|
||||||
call SpaceVim#logger#error('failed to call bootstrap_after function: ' . g:_spacevim_bootstrap_after)
|
catch
|
||||||
call SpaceVim#logger#error(' exception: ' . v:exception)
|
call SpaceVim#logger#error('failed to call bootstrap_after function: ' . g:_spacevim_bootstrap_after)
|
||||||
call SpaceVim#logger#error(' throwpoint: ' . v:throwpoint)
|
call SpaceVim#logger#error(' exception: ' . v:exception)
|
||||||
let g:_spacevim_bootstrap_after_success = 0
|
call SpaceVim#logger#error(' throwpoint: ' . v:throwpoint)
|
||||||
endtry
|
let g:_spacevim_bootstrap_after_success = 0
|
||||||
endif
|
endtry
|
||||||
|
endfunction
|
||||||
if !get(g:, '_spacevim_bootstrap_before_success', 1)
|
if has('timers')
|
||||||
echohl Error
|
call timer_start(g:spacevim_lazy_conf_timeout, function('s:bootstrap_after'))
|
||||||
echom 'bootstrap_before function failed to execute. Check `SPC h L` for errors.'
|
else
|
||||||
echohl None
|
call s:bootstrap_after()
|
||||||
endif
|
endif
|
||||||
if !get(g:, '_spacevim_bootstrap_after_success', 1)
|
|
||||||
echohl Error
|
|
||||||
echom 'bootstrap_after function failed to execute. Check `SPC h L` for errors.'
|
|
||||||
echohl None
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !filereadable('.SpaceVim.d/init.toml') && filereadable('.SpaceVim.d/init.vim')
|
if !filereadable('.SpaceVim.d/init.toml') && filereadable('.SpaceVim.d/init.vim')
|
||||||
|
Loading…
Reference in New Issue
Block a user