Add bang versions of install commands to leave the output open

This commit is contained in:
Ben Jackson 2020-07-22 22:09:49 +01:00
commit 29cb5c914b
5 changed files with 33 additions and 12 deletions

View file

@ -164,6 +164,7 @@ class DebugSession( object ):
installer.RunInstaller(
self._api_prefix,
False, # Don't leave open
*shlex.split( response ),
then = lambda: self.Start( new_launch_variables ) )
return

View file

@ -95,7 +95,7 @@ def PathToAnyWorkingPython3():
raise RuntimeError( "Unable to find a working python3" )
def RunInstaller( api_prefix, *args, **kwargs ):
def RunInstaller( api_prefix, leave_open, *args, **kwargs ):
from vimspector import utils, output, settings
import vim
@ -125,7 +125,8 @@ def RunInstaller( api_prefix, *args, **kwargs ):
def handler( exit_code ):
if exit_code == 0:
_ResetInstaller()
if not leave_open:
_ResetInstaller()
utils.UserMessage( "Vimspector gadget installation complete!" )
vim.command( 'silent doautocmd User VimspectorInstallSuccess' )
if 'then' in kwargs:
@ -143,7 +144,7 @@ def RunInstaller( api_prefix, *args, **kwargs ):
OUTPUT_VIEW.ShowOutput( 'Installer' )
def RunUpdate( api_prefix, *args ):
def RunUpdate( api_prefix, leave_open, *args ):
from vimspector import utils
Configure( vimspector_base = utils.GetVimspectorBase() )
@ -153,7 +154,7 @@ def RunUpdate( api_prefix, *args ):
args.extend( FindGadgetForAdapter( adapter_name ) )
if args:
RunInstaller( api_prefix, *args )
RunInstaller( api_prefix, leave_open, *args )
def _ResetInstaller():