mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-20 12:34:42 +02:00
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:
parent
2c05a48a26
commit
06272275b5
@ -157,6 +157,8 @@ elseif has("nvim")
|
|||||||
function! s:nvim_po_job_handler(job_id, data, event) dict
|
function! s:nvim_po_job_handler(job_id, data, event) dict
|
||||||
if a:event == 'stdout'
|
if a:event == 'stdout'
|
||||||
let self.buf .= join(a:data)
|
let self.buf .= join(a:data)
|
||||||
|
elseif a:event == 'stderr'
|
||||||
|
let self.buf .= join(a:data)
|
||||||
else " on_exit handler
|
else " on_exit handler
|
||||||
call s:po_output(self.buf, self.file)
|
call s:po_output(self.buf, self.file)
|
||||||
call airline#extensions#po#shorten()
|
call airline#extensions#po#shorten()
|
||||||
@ -190,12 +192,14 @@ elseif has("nvim")
|
|||||||
\ 'file': a:file,
|
\ 'file': a:file,
|
||||||
\ 'cwd': fnamemodify(a:file, ':p:h'),
|
\ 'cwd': fnamemodify(a:file, ':p:h'),
|
||||||
\ 'on_stdout': function('s:nvim_po_job_handler'),
|
\ 'on_stdout': function('s:nvim_po_job_handler'),
|
||||||
|
\ 'on_stderr': function('s:nvim_po_job_handler'),
|
||||||
\ 'on_exit': function('s:nvim_po_job_handler')
|
\ 'on_exit': function('s:nvim_po_job_handler')
|
||||||
\ }
|
\ }
|
||||||
if g:airline#init#is_windows && &shell =~ 'cmd'
|
if g:airline#init#is_windows && &shell =~ 'cmd'
|
||||||
let cmd = a:cmd
|
" no msgfmt on windows?
|
||||||
|
return
|
||||||
else
|
else
|
||||||
let cmd = ['sh', '-c', a:cmd]
|
let cmd = ['sh', '-c', a:cmd. shellescape(a:file)]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if has_key(s:po_jobs, a:file)
|
if has_key(s:po_jobs, a:file)
|
||||||
|
@ -27,6 +27,8 @@ function! airline#extensions#po#stats()
|
|||||||
let cmd = 'msgfmt --statistics -o /dev/null -- '
|
let cmd = 'msgfmt --statistics -o /dev/null -- '
|
||||||
if g:airline#init#async
|
if g:airline#init#async
|
||||||
call airline#async#get_msgfmt_stat(cmd, expand('%:p'))
|
call airline#async#get_msgfmt_stat(cmd, expand('%:p'))
|
||||||
|
elseif has("nvim")
|
||||||
|
call airline#async#nvim_get_msgfmt_stat(cmd, expand('%:p'))
|
||||||
else
|
else
|
||||||
let airline_po_stats = system(cmd. shellescape(expand('%:p')))
|
let airline_po_stats = system(cmd. shellescape(expand('%:p')))
|
||||||
if v:shell_error
|
if v:shell_error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user