1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 12:50: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,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')