Create a messagebox-like interface in vim

This commit is contained in:
Ben Jackson 2021-03-06 20:24:24 +00:00 committed by Ben Jackson
commit 4fbafaa462
4 changed files with 87 additions and 16 deletions

View file

@ -390,13 +390,17 @@ def ConfirmCallback( confirm_id, result ):
handler( result )
def Confirm( api_prefix, prompt, handler, default_value = 1 ):
def Confirm( api_prefix, prompt, handler, default_value = 3, options = None ):
global CONFIRM_ID
if not options:
options = [ '(Y)es', '(N)o', '(D)efault' ]
CONFIRM_ID += 1
CONFIRM[ CONFIRM_ID ] = handler
Call( f'vimspector#internal#{ api_prefix }popup#Confirm',
CONFIRM_ID,
prompt,
options,
default_value )