async: Move function definition so it is valid for nvim

This commit is contained in:
Christian Brabandt 2019-04-24 13:27:25 +02:00
parent 941341d085
commit a8c96d7c07
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
1 changed files with 10 additions and 10 deletions

View File

@ -53,6 +53,16 @@ function! s:valid_dir(dir)
return a:dir
endfunction
function! airline#async#vcs_untracked(config, file, vcs)
if g:airline#init#vim_async
" Vim 8 with async support
noa call airline#async#vim_vcs_untracked(a:config, a:file)
else
" nvim async or vim without job-feature
noa call airline#async#nvim_vcs_untracked(a:config, a:file, a:vcs)
endif
endfunction
if v:version >= 800 && has("job")
" Vim 8.0 with Job feature
" TODO: Check if we need the cwd option for the job_start() functions
@ -123,16 +133,6 @@ if v:version >= 800 && has("job")
let s:po_jobs[a:file] = id
endfunction
function! airline#async#vcs_untracked(config, file, vcs)
if g:airline#init#vim_async
" Vim 8 with async support
noa call airline#async#vim_vcs_untracked(a:config, a:file)
else
" nvim async or vim without job-feature
noa call airline#async#nvim_vcs_untracked(a:config, a:file, a:vcs)
endif
endfunction
function! airline#async#vim_vcs_untracked(config, file)
if g:airline#init#is_windows && &shell =~ 'cmd'
let cmd = a:config['cmd'] . shellescape(a:file)