fix po output not visible for nvim

Apparently, the output of msgfmt goes to stderr. So catch that one as
well.
This commit is contained in:
Christian Brabandt 2017-08-23 00:00:47 +02:00
parent 2c05a48a26
commit 06272275b5
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 8 additions and 2 deletions

View File

@ -157,6 +157,8 @@ elseif has("nvim")
function! s:nvim_po_job_handler(job_id, data, event) dict
if a:event == 'stdout'
let self.buf .= join(a:data)
elseif a:event == 'stderr'
let self.buf .= join(a:data)
else " on_exit handler
call s:po_output(self.buf, self.file)
call airline#extensions#po#shorten()
@ -190,12 +192,14 @@ elseif has("nvim")
\ 'file': a:file,
\ 'cwd': fnamemodify(a:file, ':p:h'),
\ 'on_stdout': function('s:nvim_po_job_handler'),
\ 'on_stderr': function('s:nvim_po_job_handler'),
\ 'on_exit': function('s:nvim_po_job_handler')
\ }
if g:airline#init#is_windows && &shell =~ 'cmd'
let cmd = a:cmd
" no msgfmt on windows?
return
else
let cmd = ['sh', '-c', a:cmd]
let cmd = ['sh', '-c', a:cmd. shellescape(a:file)]
endif
if has_key(s:po_jobs, a:file)

View File

@ -27,6 +27,8 @@ function! airline#extensions#po#stats()
let cmd = 'msgfmt --statistics -o /dev/null -- '
if g:airline#init#async
call airline#async#get_msgfmt_stat(cmd, expand('%:p'))
elseif has("nvim")
call airline#async#nvim_get_msgfmt_stat(cmd, expand('%:p'))
else
let airline_po_stats = system(cmd. shellescape(expand('%:p')))
if v:shell_error