Compare commits
1 commit
master
...
restart-ch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89d77870e7 |
1 changed files with 18 additions and 6 deletions
|
|
@ -94,6 +94,16 @@ _vimspector_session.OnRequestTimeout( vim.eval( 'a:id' ) )
|
||||||
EOF
|
EOF
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:KillJob() abort
|
||||||
|
if exists( 's:job' )
|
||||||
|
if job_status( s:job ) ==# 'run'
|
||||||
|
call job_stop( s:job, 'kill' )
|
||||||
|
endif
|
||||||
|
unlet s:job
|
||||||
|
sleep 500m
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! vimspector#internal#channel#StopDebugSession() abort
|
function! vimspector#internal#channel#StopDebugSession() abort
|
||||||
if exists( 's:ch' ) && ch_status( s:ch ) ==# 'open'
|
if exists( 's:ch' ) && ch_status( s:ch ) ==# 'open'
|
||||||
" channel is open, close it and trigger the callback. The callback is _not_
|
" channel is open, close it and trigger the callback. The callback is _not_
|
||||||
|
|
@ -101,15 +111,17 @@ function! vimspector#internal#channel#StopDebugSession() abort
|
||||||
" is not open, then we there is a _OnClose callback waiting for us, so do
|
" is not open, then we there is a _OnClose callback waiting for us, so do
|
||||||
" nothing.
|
" nothing.
|
||||||
call ch_close( s:ch )
|
call ch_close( s:ch )
|
||||||
|
while ch_status( s:ch ) ==# 'buffered'
|
||||||
|
let data = ch_read( s:ch, {'timeout': 0} )
|
||||||
|
if data == ''
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
call s:_OnServerData( s:ch, data )
|
||||||
|
endwhile
|
||||||
call s:_OnClose( s:ch )
|
call s:_OnClose( s:ch )
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists( 's:job' )
|
call s:KillJob()
|
||||||
if job_status( s:job ) ==# 'run'
|
|
||||||
call job_stop( s:job, 'kill' )
|
|
||||||
endif
|
|
||||||
unlet s:job
|
|
||||||
endif
|
|
||||||
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