aboutsummaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-18 23:52:52 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-18 23:52:52 +0900
commit2eb802d2bd1cc13bece981d9af7752240aa33322 (patch)
treee824b045817532e6834008ad691bd2f6e97977df /autoload
parent92500966993fd19b8fe3050b1c2d9572a46151a6 (diff)
downloadvim-lsp-settings-2eb802d2bd1cc13bece981d9af7752240aa33322.tar.gz
vim-lsp-settings-2eb802d2bd1cc13bece981d9af7752240aa33322.tar.bz2
vim-lsp-settings-2eb802d2bd1cc13bece981d9af7752240aa33322.zip
JSON Schemas
Diffstat (limited to 'autoload')
-rw-r--r--autoload/lsp_settings.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim
index 08a8b3e..60d29d3 100644
--- a/autoload/lsp_settings.vim
+++ b/autoload/lsp_settings.vim
@@ -4,6 +4,9 @@ function! lsp_settings#get(name, key, default) abort
let l:config = get(g:, 'lsp_settings', {})
if !has_key(l:config, a:name)
if !has_key(l:config, '*')
+ if type(a:default) ==# v:t_func
+ return a:default()
+ endif
return a:default
endif
let l:config = l:config['*']
@@ -11,6 +14,9 @@ function! lsp_settings#get(name, key, default) abort
let l:config = l:config[a:name]
endif
if !has_key(l:config, a:key)
+ if type(a:default) ==# v:t_func
+ return a:default()
+ endif
return a:default
endif
return l:config[a:key]