mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-03-02 05:16:50 +08:00
fixup for async feature
This commit is contained in:
@@ -27,10 +27,11 @@ if s:has_async
|
||||
else
|
||||
let b:airline_po_stats = ''
|
||||
endif
|
||||
call remove(s:jobs, self.file)
|
||||
call s:shorten()
|
||||
endfunction
|
||||
|
||||
function! s:DoAsyncPO(cmd, file)
|
||||
function! s:get_msgfmt_stat_async(cmd, file)
|
||||
if g:airline#util#is_windows || !executable('msgfmt')
|
||||
" no msgfmt on windows?
|
||||
return
|
||||
@@ -42,8 +43,7 @@ if s:has_async
|
||||
if has_key(s:jobs, a:file)
|
||||
if job_status(get(s:jobs, a:file)) == 'run'
|
||||
return
|
||||
else
|
||||
call job_stop(get(s:jobs, a:file))
|
||||
elseif has_key(s:jobs, a:file)
|
||||
call remove(s:jobs, a:file)
|
||||
endif
|
||||
endif
|
||||
@@ -69,7 +69,7 @@ function! airline#extensions#po#stats()
|
||||
|
||||
let cmd = 'msgfmt --statistics -o /dev/null -- '
|
||||
if s:has_async
|
||||
call s:DoAsyncPO(cmd, expand('%:p'))
|
||||
call s:get_msgfmt_stat_async(cmd, expand('%:p'))
|
||||
else
|
||||
let airline_po_stats = system(cmd. shellescape(expand('%:p')))
|
||||
if v:shell_error
|
||||
|
||||
Reference in New Issue
Block a user