diff options
author | prabirshrestha <mail@prabir.me> | 2020-01-01 09:33:43 -0800 |
---|---|---|
committer | prabirshrestha <mail@prabir.me> | 2020-01-01 09:39:02 -0800 |
commit | 6bce9c34fc0445580a9ea3cdf011a5110b23e6bd (patch) | |
tree | d04d2d65d99978a2c1ce58af61d698b9da83add2 /plugin | |
parent | bcbc1a04f0155f917ec0d08364580b2c62d0fc69 (diff) | |
download | vim-lsp-settings-6bce9c34fc0445580a9ea3cdf011a5110b23e6bd.tar.gz vim-lsp-settings-6bce9c34fc0445580a9ea3cdf011a5110b23e6bd.tar.bz2 vim-lsp-settings-6bce9c34fc0445580a9ea3cdf011a5110b23e6bd.zip |
add support for neovim
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/lsp_settings.vim | 15 |
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 |