diff options
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2020-01-24 11:57:01 +0900 |
---|---|---|
committer | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2020-01-24 11:57:01 +0900 |
commit | 8c6b4c326de02c27b9727e3f711bf17ba124efbd (patch) | |
tree | e4531368ef2c1abf9eeef0f4ffa8f869979b6855 /plugin/lsp_settings.vim | |
parent | fa3e80bb4cccf02eb25e654318b4509ab954f74e (diff) | |
download | vim-lsp-settings-8c6b4c326de02c27b9727e3f711bf17ba124efbd.tar.gz vim-lsp-settings-8c6b4c326de02c27b9727e3f711bf17ba124efbd.tar.bz2 vim-lsp-settings-8c6b4c326de02c27b9727e3f711bf17ba124efbd.zip |
Handle only once for the filetype.
Diffstat (limited to 'plugin/lsp_settings.vim')
-rw-r--r-- | plugin/lsp_settings.vim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugin/lsp_settings.vim b/plugin/lsp_settings.vim index 264aa1f..06969b0 100644 --- a/plugin/lsp_settings.vim +++ b/plugin/lsp_settings.vim @@ -8,6 +8,7 @@ let s:checkers_dir = expand('<sfile>:h:h').'/checkers' let s:installer_dir = expand('<sfile>:h:h').'/installer' let s:servers_dir = expand('<sfile>:h:h').'/servers' let s:settings = json_decode(join(readfile(expand('<sfile>:h:h').'/settings.json'), "\n")) +let s:ftmap = {} function! s:executable(cmd) abort if executable(a:cmd) @@ -186,6 +187,9 @@ function! s:vimlsp_suggest_plugin() abort endfunction function! s:vimlsp_load_or_suggest(ft) abort + if get(s:ftmap, a:ft, 0) + return + endif let l:group_name = s:load_or_suggest_group_name(a:ft) exe 'augroup' l:group_name au! @@ -236,6 +240,7 @@ function! s:vimlsp_load_or_suggest(ft) abort if filereadable(l:script) exe 'source' l:script let l:found += 1 + let s:ftmap[a:ft] = 1 break endif endfor |