mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-23 02:52:15 +08: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
|
||||
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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user