aboutsummaryrefslogtreecommitdiff
path: root/plugin/lsp_settings.vim
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-24 11:57:01 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-24 11:57:01 +0900
commit8c6b4c326de02c27b9727e3f711bf17ba124efbd (patch)
treee4531368ef2c1abf9eeef0f4ffa8f869979b6855 /plugin/lsp_settings.vim
parentfa3e80bb4cccf02eb25e654318b4509ab954f74e (diff)
downloadvim-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.vim5
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