fixup for async feature

This commit is contained in:
Christian Brabandt
2016-10-09 15:47:23 +02:00
parent 81ccd3bdf6
commit 4f8a16c31e
2 changed files with 14 additions and 14 deletions

View File

@@ -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