Nvim: change stdout handler according to :h on_exit

This commit is contained in:
Marco Hinz 2019-08-14 15:22:36 +02:00
parent e77a402cc6
commit b686925732
No known key found for this signature in database
GPG Key ID: 1C980A1B657B4A4F

View File

@ -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('%'),
\ } \ }