Fix actually sending terminateDebugee, and fix neovim 1-based index reporting

This commit is contained in:
Ben Jackson 2021-03-19 18:23:48 +00:00
commit a39017dd06
2 changed files with 11 additions and 8 deletions

View file

@ -103,8 +103,10 @@ function! vimspector#internal#neopopup#Confirm( confirm_id,
let result = -1
endtry
" Map the results to what popup_menu_filter would return (ok s:ConfirmCallback
" in popup.vim)
" Map the results to what the vim popup stuff would return (s:ConfirmCallback
" in popup.vim), i.e.:
" - 1-based index of selected item, or
" - -1 or 0 for cancellation
if result == ''
" User pressed ESC/ctrl-c
let result = -1
@ -115,10 +117,10 @@ function! vimspector#internal#neopopup#Confirm( confirm_id,
let result = index
break
endif
let index += 2
let index += 1
endfor
if index >= len( a:keys )
if index > len( a:keys )
let result = -1
endif
endif

View file

@ -916,7 +916,9 @@ class DebugSession( object ):
self._logger.info( 'Debug Adapter Started' )
def _StopDebugAdapter( self, interactive = False, callback = None ):
def disconnect( arguments = {} ):
arguments = {}
def disconnect():
self._splash_screen = utils.DisplaySplash(
self._api_prefix,
self._splash_screen,
@ -936,7 +938,7 @@ class DebugSession( object ):
self._connection.DoRequest( handler, {
'command': 'disconnect',
'arguments': {},
'arguments': arguments,
}, failure_handler = handler, timeout = 5000 )
if not interactive:
@ -947,7 +949,6 @@ class DebugSession( object ):
disconnect()
else:
def handle_choice( choice ):
arguments = {}
if choice == 1:
# yes
arguments[ 'terminateDebuggee' ] = True
@ -959,7 +960,7 @@ class DebugSession( object ):
return
# Else, use server default
disconnect( arguments )
disconnect()
utils.Confirm( self._api_prefix,
"Terminate debuggee?",