From 60a039f6c2914e0d6320a063032c03c8fdda0760 Mon Sep 17 00:00:00 2001 From: thinca Date: Tue, 31 Dec 2019 18:56:18 +0900 Subject: Setup server directory in Vim script All installer scripts assume invoked at the installing path. --- plugin/lsp_settings.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'plugin') 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 -- cgit v1.2.3-54-g00ecf