Fix actually sending terminateDebugee, and fix neovim 1-based index reporting
This commit is contained in:
parent
c05335c799
commit
a39017dd06
2 changed files with 11 additions and 8 deletions
|
|
@ -103,8 +103,10 @@ function! vimspector#internal#neopopup#Confirm( confirm_id,
|
||||||
let result = -1
|
let result = -1
|
||||||
endtry
|
endtry
|
||||||
|
|
||||||
" Map the results to what popup_menu_filter would return (ok s:ConfirmCallback
|
" Map the results to what the vim popup stuff would return (s:ConfirmCallback
|
||||||
" in popup.vim)
|
" in popup.vim), i.e.:
|
||||||
|
" - 1-based index of selected item, or
|
||||||
|
" - -1 or 0 for cancellation
|
||||||
if result == ''
|
if result == ''
|
||||||
" User pressed ESC/ctrl-c
|
" User pressed ESC/ctrl-c
|
||||||
let result = -1
|
let result = -1
|
||||||
|
|
@ -115,10 +117,10 @@ function! vimspector#internal#neopopup#Confirm( confirm_id,
|
||||||
let result = index
|
let result = index
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
let index += 2
|
let index += 1
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
if index >= len( a:keys )
|
if index > len( a:keys )
|
||||||
let result = -1
|
let result = -1
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -916,7 +916,9 @@ class DebugSession( object ):
|
||||||
self._logger.info( 'Debug Adapter Started' )
|
self._logger.info( 'Debug Adapter Started' )
|
||||||
|
|
||||||
def _StopDebugAdapter( self, interactive = False, callback = None ):
|
def _StopDebugAdapter( self, interactive = False, callback = None ):
|
||||||
def disconnect( arguments = {} ):
|
arguments = {}
|
||||||
|
|
||||||
|
def disconnect():
|
||||||
self._splash_screen = utils.DisplaySplash(
|
self._splash_screen = utils.DisplaySplash(
|
||||||
self._api_prefix,
|
self._api_prefix,
|
||||||
self._splash_screen,
|
self._splash_screen,
|
||||||
|
|
@ -936,7 +938,7 @@ class DebugSession( object ):
|
||||||
|
|
||||||
self._connection.DoRequest( handler, {
|
self._connection.DoRequest( handler, {
|
||||||
'command': 'disconnect',
|
'command': 'disconnect',
|
||||||
'arguments': {},
|
'arguments': arguments,
|
||||||
}, failure_handler = handler, timeout = 5000 )
|
}, failure_handler = handler, timeout = 5000 )
|
||||||
|
|
||||||
if not interactive:
|
if not interactive:
|
||||||
|
|
@ -947,7 +949,6 @@ class DebugSession( object ):
|
||||||
disconnect()
|
disconnect()
|
||||||
else:
|
else:
|
||||||
def handle_choice( choice ):
|
def handle_choice( choice ):
|
||||||
arguments = {}
|
|
||||||
if choice == 1:
|
if choice == 1:
|
||||||
# yes
|
# yes
|
||||||
arguments[ 'terminateDebuggee' ] = True
|
arguments[ 'terminateDebuggee' ] = True
|
||||||
|
|
@ -959,7 +960,7 @@ class DebugSession( object ):
|
||||||
return
|
return
|
||||||
# Else, use server default
|
# Else, use server default
|
||||||
|
|
||||||
disconnect( arguments )
|
disconnect()
|
||||||
|
|
||||||
utils.Confirm( self._api_prefix,
|
utils.Confirm( self._api_prefix,
|
||||||
"Terminate debuggee?",
|
"Terminate debuggee?",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue