aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-27 15:21:50 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-27 15:21:50 +0900
commit38ab9a5ec7f8cce9bcdf239ad31431ae5e3101be (patch)
treeeb40bba3042e206433a755d144e89226d20863bc
parentf10d6a9c859e89a8d02ad468a250c782170159eb (diff)
downloadvim-lsp-settings-38ab9a5ec7f8cce9bcdf239ad31431ae5e3101be.tar.gz
vim-lsp-settings-38ab9a5ec7f8cce9bcdf239ad31431ae5e3101be.tar.bz2
vim-lsp-settings-38ab9a5ec7f8cce9bcdf239ad31431ae5e3101be.zip
Use root_dir
-rw-r--r--autoload/lsp_settings.vim3
-rw-r--r--plugin/lsp_settings.vim2
2 files changed, 3 insertions, 2 deletions
diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim
index 51ff952..e8419a8 100644
--- a/autoload/lsp_settings.vim
+++ b/autoload/lsp_settings.vim
@@ -1,5 +1,6 @@
let s:servers_dir = expand('<sfile>:h:h').'/servers'
let s:installer_dir = expand('<sfile>:h:h').'/installer'
+let s:root_dir = expand('<sfile>:h:h')
function! lsp_settings#get(name, key, default) abort
let l:config = get(g:, 'lsp_settings', {})
@@ -100,7 +101,7 @@ function! lsp_settings#autocd(server_info) abort
endfunction
function! lsp_settings#complete_installer(arglead, cmdline, cursorpos) abort
- let l:settings = json_decode(join(readfile(expand('<sfile>:h:h').'/settings.json'), "\n"))
+ let l:settings = json_decode(join(readfile(s:root_dir . '/settings.json'), "\n"))
call remove(l:settings, '$schema')
let l:ft = tolower(get(split(&filetype, '\.'), 0, ''))
diff --git a/plugin/lsp_settings.vim b/plugin/lsp_settings.vim
index 2fade35..569e28d 100644
--- a/plugin/lsp_settings.vim
+++ b/plugin/lsp_settings.vim
@@ -14,7 +14,7 @@ let s:settings_dir = expand('<sfile>:h:h').'/settings'
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:settings = json_decode(join(readfile(expand('<sfile>:h:h') . '/settings.json'), "\n"))
let s:ftmap = {}
call remove(s:settings, '$schema')