async: only use nvim functions, when actually using neovim

closes #1542
This commit is contained in:
Christian Brabandt 2017-08-25 16:48:45 +02:00
parent 42e5c82d64
commit f4caf598fa
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -213,6 +213,9 @@ endif
" Should work in either Vim pre 8 or Nvim " Should work in either Vim pre 8 or Nvim
function! airline#async#nvim_vcs_untracked(cfg, file, vcs) function! airline#async#nvim_vcs_untracked(cfg, file, vcs)
let cmd = a:cfg.cmd . shellescape(a:file)
let id = -1
if has("nvim")
let config = { let config = {
\ 'buf': '', \ 'buf': '',
\ 'vcs': a:vcs, \ 'vcs': a:vcs,
@ -222,10 +225,6 @@ function! airline#async#nvim_vcs_untracked(cfg, file, vcs)
\ 'on_stdout': function('s:nvim_untracked_job_handler'), \ 'on_stdout': function('s:nvim_untracked_job_handler'),
\ 'on_exit': function('s:nvim_untracked_job_handler') \ 'on_exit': function('s:nvim_untracked_job_handler')
\ } \ }
let cmd = a:cfg.cmd . shellescape(a:file)
if !has("nvim")
let id = -1
else
if has_key(s:untracked_jobs, config.file) if has_key(s:untracked_jobs, config.file)
" still running " still running
return return