Only respond to data events for the _current_ job, not buffered data for old jobs
This commit is contained in:
parent
5ce4147361
commit
3643c2effd
1 changed files with 16 additions and 2 deletions
|
|
@ -20,7 +20,7 @@ set cpoptions&vim
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
function! s:_OnServerData( channel, data ) abort
|
function! s:_OnServerData( channel, data ) abort
|
||||||
if !exists( 's:job' )
|
if !exists( 's:job' ) || ch_getjob( a:channel ) isnot s:job
|
||||||
call ch_log( 'Get data after process exit' )
|
call ch_log( 'Get data after process exit' )
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
@ -29,7 +29,7 @@ function! s:_OnServerData( channel, data ) abort
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:_OnServerError( channel, data ) abort
|
function! s:_OnServerError( channel, data ) abort
|
||||||
if !exists( 's:job' )
|
if !exists( 's:job' ) || ch_getjob( a:channel ) isnot s:job
|
||||||
call ch_log( 'Get data after process exit' )
|
call ch_log( 'Get data after process exit' )
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
@ -37,7 +37,16 @@ function! s:_OnServerError( channel, data ) abort
|
||||||
py3 _vimspector_session.OnServerStderr( vim.eval( 'a:data' ) )
|
py3 _vimspector_session.OnServerStderr( vim.eval( 'a:data' ) )
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" FIXME: We should wait until both the exit_cb _and_ the channel closed callback
|
||||||
|
" have been received before OnServerExit?
|
||||||
|
|
||||||
function! s:_OnExit( channel, status ) abort
|
function! s:_OnExit( channel, status ) abort
|
||||||
|
if !exists( 's:job' ) || ch_getjob( a:channel ) isnot s:job
|
||||||
|
call ch_log( 'Unexpected exit callback' )
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
echom 'Channel exit with status ' . a:status
|
echom 'Channel exit with status ' . a:status
|
||||||
redraw
|
redraw
|
||||||
if exists( 's:job' )
|
if exists( 's:job' )
|
||||||
|
|
@ -47,6 +56,11 @@ function! s:_OnExit( channel, status ) abort
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:_OnClose( channel ) abort
|
function! s:_OnClose( channel ) abort
|
||||||
|
if !exists( 's:job' ) || job_getchannel( s:job ) != a:channel
|
||||||
|
call ch_log( 'Channel closed after exit' )
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
echom 'Channel closed'
|
echom 'Channel closed'
|
||||||
redraw
|
redraw
|
||||||
endfunction
|
endfunction
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue