aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2020-02-12 09:42:29 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2020-02-12 09:42:29 +0900
commit67dd6f4a23c9f85412f12779d44df00545c82f31 (patch)
tree296c5ff8ea9f7d674018bb7495a43ce0a754dc66
parentc69a2666210f31d52823a4a3faacaeaff732ae3f (diff)
downloadvim-lsp-settings-67dd6f4a23c9f85412f12779d44df00545c82f31.tar.gz
vim-lsp-settings-67dd6f4a23c9f85412f12779d44df00545c82f31.tar.bz2
vim-lsp-settings-67dd6f4a23c9f85412f12779d44df00545c82f31.zip
Check FileType in little later
-rw-r--r--autoload/lsp_settings.vim8
1 files changed, 6 insertions, 2 deletions
diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim
index 913c798..4057260 100644
--- a/autoload/lsp_settings.vim
+++ b/autoload/lsp_settings.vim
@@ -333,8 +333,12 @@ function! s:vim_lsp_suggest_plugin() abort
endfor
endfunction
+function! s:vim_lsp_load_or_suggest_delay(ft) abort
+ call timer_start(0, {timer -> s:vim_lsp_load_or_suggest(a:ft)})
+endfunction
+
function! s:vim_lsp_load_or_suggest(ft) abort
- if !has_key(s:settings, a:ft)
+ if &filetype !=# a:ft || !has_key(s:settings, a:ft)
return
endif
@@ -431,7 +435,7 @@ function! lsp_settings#init() abort
endif
exe 'augroup' lsp_settings#utils#group_name(l:ft)
autocmd!
- exe 'autocmd FileType' l:ft printf("call s:vim_lsp_load_or_suggest('%s')", l:ft)
+ exe 'autocmd FileType' l:ft 'call' printf("s:vim_lsp_load_or_suggest_delay('%s')", l:ft)
augroup END
endfor
augroup vim_lsp_suggest