aboutsummaryrefslogtreecommitdiff
path: root/plugin/lsp_settings.vim
diff options
context:
space:
mode:
authorthinca <thinca@gmail.com>2019-12-31 18:56:18 +0900
committerthinca <thinca@gmail.com>2019-12-31 18:56:18 +0900
commit60a039f6c2914e0d6320a063032c03c8fdda0760 (patch)
treeba53fd4948160d5b2980d4f7ae3484178d40ce77 /plugin/lsp_settings.vim
parent796a6b950a3c520ec24139836135c35364cf941d (diff)
downloadvim-lsp-settings-60a039f6c2914e0d6320a063032c03c8fdda0760.tar.gz
vim-lsp-settings-60a039f6c2914e0d6320a063032c03c8fdda0760.tar.bz2
vim-lsp-settings-60a039f6c2914e0d6320a063032c03c8fdda0760.zip
Setup server directory in Vim script
All installer scripts assume invoked at the installing path.
Diffstat (limited to 'plugin/lsp_settings.vim')
-rw-r--r--plugin/lsp_settings.vim9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugin/lsp_settings.vim b/plugin/lsp_settings.vim
index 51aae02..5a7823c 100644
--- a/plugin/lsp_settings.vim
+++ b/plugin/lsp_settings.vim
@@ -97,8 +97,13 @@ endfunction
function! s:vimlsp_install_server() abort
let l:entry = s:vimlsp_installer()
- exe 'terminal' l:entry[1]
- let l:job = term_getjob(bufnr('%'))
+ let l:server_install_dir = s:servers_dir . '/' . l:entry[0]
+ if isdirectory(l:server_install_dir)
+ call delete(l:server_install_dir, 'rf')
+ endif
+ call mkdir(l:server_install_dir, 'p')
+ let l:bufnr = term_start(l:entry[1], {'cwd': l:server_install_dir})
+ let l:job = term_getjob(l:bufnr)
if l:job != v:null
call job_setoptions(l:job, {'exit_cb': function('s:vimlsp_install_server_post', [l:entry[0]])})
endif