revert lazy load

This commit is contained in:
Yasuhiro Matsumoto
2025-11-28 21:56:56 +09:00
parent 3321ad0351
commit 928fe58f1d
2 changed files with 18 additions and 12 deletions

View File

@@ -657,12 +657,14 @@ function! lsp_settings#init() abort
command! -bang -nargs=? -complete=customlist,lsp_settings#complete_install LspInstallServer call s:vim_lsp_install_server(&l:filetype, <q-args>, '<bang>') command! -bang -nargs=? -complete=customlist,lsp_settings#complete_install LspInstallServer call s:vim_lsp_install_server(&l:filetype, <q-args>, '<bang>')
call s:vim_lsp_load_or_suggest('_') call s:vim_lsp_load_or_suggest('_')
doautocmd BufNewFile,BufEnter if get(g:, 'lsp_settings_lazyload', 0)
for l:buf in range(1, bufnr('$')) doautocmd BufNewFile,BufEnter
if !bufexists(l:buf) || !bufloaded(l:buf) for l:buf in range(1, bufnr('$'))
continue if !bufexists(l:buf) || !bufloaded(l:buf)
endif continue
call lsp#log_verbose('lsp#ensure_flush_all()', l:buf) endif
call lsp#ensure_flush_all(l:buf, lsp#get_allowed_servers(l:buf)) call lsp#log_verbose('lsp#ensure_flush_all()', l:buf)
endfor call lsp#ensure_flush_all(l:buf, lsp#get_allowed_servers(l:buf))
endfor
endif
endfunction endfunction

View File

@@ -16,7 +16,11 @@ command! -nargs=? LspSettingsLocalEdit call lsp_settings#profile#edit_local(<f-a
command! -nargs=0 LspSettingsGlobalEdit call lsp_settings#profile#edit_global() command! -nargs=0 LspSettingsGlobalEdit call lsp_settings#profile#edit_global()
command! -nargs=0 LspManageServers call lsp_settings#ui#open() command! -nargs=0 LspManageServers call lsp_settings#ui#open()
augroup vim_lsp_settings_initialize if get(g:, 'lsp_settings_lazyload', 0)
au! augroup vim_lsp_settings_initialize
autocmd VimEnter * call lsp_settings#init() au!
augroup END autocmd VimEnter * call lsp_settings#init()
augroup END
else
call lsp_settings#init()
endif