Nvim: change stdout handler according to :h on_exit
This commit is contained in:
parent
e77a402cc6
commit
b686925732
@ -12,13 +12,8 @@ endfunction
|
|||||||
|
|
||||||
" Function: s:callback_nvim_stdout{{{1
|
" Function: s:callback_nvim_stdout{{{1
|
||||||
function! s:callback_nvim_stdout(_job_id, data, _event) dict abort
|
function! s:callback_nvim_stdout(_job_id, data, _event) dict abort
|
||||||
if empty(self.stdoutbuf) || empty(self.stdoutbuf[-1])
|
let self.stdoutbuf[-1] .= a:data[0]
|
||||||
let self.stdoutbuf += a:data
|
call extend(self.stdoutbuf, a:data[1:])
|
||||||
else
|
|
||||||
let self.stdoutbuf = self.stdoutbuf[:-2]
|
|
||||||
\ + [self.stdoutbuf[-1] . get(a:data, 0, '')]
|
|
||||||
\ + a:data[1:]
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: s:callback_nvim_exit {{{1
|
" Function: s:callback_nvim_exit {{{1
|
||||||
@ -363,7 +358,7 @@ function! s:initialize_job(vcs) abort
|
|||||||
let cmd = ['sh', '-c', vcs_cmd]
|
let cmd = ['sh', '-c', vcs_cmd]
|
||||||
endif
|
endif
|
||||||
let options = {
|
let options = {
|
||||||
\ 'stdoutbuf': [],
|
\ 'stdoutbuf': [''],
|
||||||
\ 'vcs': a:vcs,
|
\ 'vcs': a:vcs,
|
||||||
\ 'bufnr': bufnr('%'),
|
\ 'bufnr': bufnr('%'),
|
||||||
\ }
|
\ }
|
||||||
|
Loading…
Reference in New Issue
Block a user