aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2019-12-31 22:45:44 +0900
committerGitHub <noreply@github.com>2019-12-31 22:45:44 +0900
commit319f7ad838e62a182ccff654c832d63733ed3719 (patch)
treed7d3b91d300d27f4539fa7a7d16c74def1b21fae /plugin
parent0f1e1f8c37b3f178aba4dc4cae9e20093d4ecc39 (diff)
parent054bcea28eb0b044eb8d44c2e7a4cf3de4ebada4 (diff)
downloadvim-lsp-settings-319f7ad838e62a182ccff654c832d63733ed3719.tar.gz
vim-lsp-settings-319f7ad838e62a182ccff654c832d63733ed3719.tar.bz2
vim-lsp-settings-319f7ad838e62a182ccff654c832d63733ed3719.zip
Merge pull request #49 from thinca/setup-server-dir-in-vim-script
Setup server directory in Vim script
Diffstat (limited to 'plugin')
-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 a92daa5..23146a6 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