Fix shutdown sequence for channel-based servers
This commit is contained in:
parent
4de1269baa
commit
90ecd905d9
1 changed files with 7 additions and 8 deletions
|
|
@ -30,15 +30,11 @@ function! s:_OnServerError( channel, data ) abort
|
||||||
redraw
|
redraw
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:_OnExit( channel, status ) abort
|
|
||||||
echom 'Channel exit with status ' . a:status
|
|
||||||
redraw
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:_OnClose( channel ) abort
|
function! s:_OnClose( channel ) abort
|
||||||
echom 'Channel closed'
|
echom 'Channel closed'
|
||||||
redraw
|
redraw
|
||||||
" py3 _vimspector_session.OnChannelClosed()
|
unlet s:ch
|
||||||
|
py3 _vimspector_session.OnServerExit( 0 )
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:_Send( msg ) abort
|
function! s:_Send( msg ) abort
|
||||||
|
|
@ -84,10 +80,13 @@ function! vimspector#internal#channel#StopDebugSession() abort
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ch_status( s:ch ) ==# 'open'
|
if ch_status( s:ch ) ==# 'open'
|
||||||
|
" channel is open, close it and trigger the callback. The callback is _not_
|
||||||
|
" triggered when manually calling ch_close. if we get here and the channel
|
||||||
|
" is not open, then we there is a _OnClose callback waiting for us, so do
|
||||||
|
" nothing.
|
||||||
call ch_close( s:ch )
|
call ch_close( s:ch )
|
||||||
|
call s:_OnClose( s:ch )
|
||||||
endif
|
endif
|
||||||
|
|
||||||
unlet s:ch
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! vimspector#internal#channel#Reset() abort
|
function! vimspector#internal#channel#Reset() abort
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue