1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 22:30:04 +08:00

fix(bootstrap): use timer for bootstrap_after

This commit is contained in:
Eric Wong 2024-07-24 17:51:14 +08:00
parent f725666783
commit a974fb5646

View File

@ -26,6 +26,7 @@ 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', ''))
function! s:bootstrap_after(...) abort
try try
call call(g:_spacevim_bootstrap_after, []) call call(g:_spacevim_bootstrap_after, [])
let g:_spacevim_bootstrap_after_success = 1 let g:_spacevim_bootstrap_after_success = 1
@ -35,17 +36,12 @@ if has('nvim-0.10.0')
call SpaceVim#logger#error(' throwpoint: ' . v:throwpoint) call SpaceVim#logger#error(' throwpoint: ' . v:throwpoint)
let g:_spacevim_bootstrap_after_success = 0 let g:_spacevim_bootstrap_after_success = 0
endtry endtry
endfunction
if has('timers')
call timer_start(g:spacevim_lazy_conf_timeout, function('s:bootstrap_after'))
else
call s:bootstrap_after()
endif endif
if !get(g:, '_spacevim_bootstrap_before_success', 1)
echohl Error
echom 'bootstrap_before function failed to execute. Check `SPC h L` for errors.'
echohl None
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')