diff --git a/autoload/airline/extensions/branch.vim b/autoload/airline/extensions/branch.vim index 661cab33..fe439771 100644 --- a/autoload/airline/extensions/branch.vim +++ b/autoload/airline/extensions/branch.vim @@ -11,8 +11,6 @@ if !s:has_fugitive && !s:has_lawrencium && !s:has_vcscommand finish endif -let s:has_async = airline#util#async - " s:vcs_config contains static configuration of VCSes and their status relative " to the active file. " 'branch' - The name of currently active branch. This field is empty iff it @@ -123,7 +121,7 @@ endfunction function! s:update_hg_branch(path) if s:has_lawrencium let stl=lawrencium#statusline() - if !empty(stl) && s:has_async + if !empty(stl) && g:airline#init#async call s:get_mq_async('LC_ALL=C hg qtop', expand('%:p')) endif if exists("s:mq") && !empty(s:mq) @@ -183,7 +181,7 @@ function! s:update_untracked() for vcs in keys(s:vcs_config) let l:config = s:vcs_config[vcs] - if s:has_async + if g:airline#init#async " Note that asynchronous update updates s:vcs_config only, and only " s:update_untracked updates b:buffer_vcs_config. If s:vcs_config is " invalidated again before s:update_untracked is called, then we lose the @@ -202,7 +200,7 @@ function! s:update_untracked() endfor endfunction -if s:has_async +if g:airline#init#async let s:jobs = {} function! s:on_stdout(channel, msg) dict abort @@ -377,7 +375,7 @@ endfunction function! s:reset_untracked_cache(shellcmdpost) " shellcmdpost - whether function was called as a result of ShellCmdPost hook - if !s:has_async && !has('nvim') + if !g:airline#init#async && !has('nvim') if a:shellcmdpost " Clear cache only if there was no error or the script uses an " asynchronous interface. Otherwise, cache clearing would overwrite diff --git a/autoload/airline/extensions/po.vim b/autoload/airline/extensions/po.vim index 65364362..f4e2fb00 100644 --- a/autoload/airline/extensions/po.vim +++ b/autoload/airline/extensions/po.vim @@ -3,8 +3,6 @@ scriptencoding utf-8 -let s:has_async = airline#util#async - function! s:shorten() if exists("g:airline#extensions#po#displayed_limit") let w:displayed_po_limit = g:airline#extensions#po#displayed_limit @@ -14,7 +12,7 @@ function! s:shorten() endif endfunction -if s:has_async +if airline#init#async let s:jobs = {} function! s:on_stdout(channel, msg) dict abort @@ -70,7 +68,7 @@ function! airline#extensions#po#stats() endif let cmd = 'msgfmt --statistics -o /dev/null -- ' - if s:has_async + if airline#init#async call s:get_msgfmt_stat_async(cmd, expand('%:p')) else let airline_po_stats = system(cmd. shellescape(expand('%:p'))) diff --git a/autoload/airline/init.vim b/autoload/airline/init.vim index 1c68429e..4ee6fdb4 100644 --- a/autoload/airline/init.vim +++ b/autoload/airline/init.vim @@ -18,7 +18,7 @@ function! airline#init#bootstrap() let g:airline#init#bootstrapping = 1 - let g:airline#util#async = v:version >= 800 && has('job') + let g:airline#init#async = (has("nvim") || (v:version >= 800 && has('job'))) let g:airline#util#is_windows = has('win32') || has('win64') call s:check_defined('g:airline_detect_modified', 1)