aboutsummaryrefslogtreecommitdiff
path: root/plugin/lsp_settings.vim
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/lsp_settings.vim')
-rw-r--r--plugin/lsp_settings.vim15
1 files changed, 10 insertions, 5 deletions
diff --git a/plugin/lsp_settings.vim b/plugin/lsp_settings.vim
index 1081bf5..313ddad 100644
--- a/plugin/lsp_settings.vim
+++ b/plugin/lsp_settings.vim
@@ -77,7 +77,7 @@ function! s:vimlsp_installer() abort
return []
endfunction
-function! s:vimlsp_install_server_post(command, job, code) abort
+function! s:vimlsp_install_server_post(command, job, code, ...) abort
if a:code != 0
return
endif
@@ -104,10 +104,15 @@ function! s:vimlsp_install_server() abort
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]])})
+ if has('nvim')
+ split new
+ call termopen(l:entry[1], {'cwd': l:server_install_dir, 'on_exit': function('s:vimlsp_install_server_post', [l:entry[0]])}) | startinsert
+ else
+ 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
endif
endfunction