From 2fa6142c8f8acc80b088eec6ecb08677e9b01aff Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Thu, 31 Dec 2020 20:55:35 +0000 Subject: [PATCH] FixUp: save config --- python3/vimspector/launch.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/python3/vimspector/launch.py b/python3/vimspector/launch.py index c4f0af4..6eada0d 100644 --- a/python3/vimspector/launch.py +++ b/python3/vimspector/launch.py @@ -173,10 +173,13 @@ def SaveConfiguration( configuration ): if not gen: return - config_path = utils.AskForInput( - f'Would you like to save the configuration named "{ gen[ "name" ] }"' - '? Enter the path to save to (ctrl-c to cancel): ', - gen[ 'path' ] ) + if utils.Confirm( + f'Would you like to save the configuration named "{ gen[ "name" ] }"', + '&Yes\n&No' ) != 1: + return + + config_path = utils.AskForInput( 'Enter the path to save to: ', + gen[ 'path' ] ) if not config_path: return @@ -185,7 +188,7 @@ def SaveConfiguration( configuration ): current_contents = {} if os.path.exists( config_path ): - if utils.Confirm( 'File exists, overwrite? (NOTE: comments and ' + if utils.Confirm( 'File exists, overwrite?\n(NOTE: comments and ' 'formatting in the existing file will be LOST!!)', '&Yes\n&No' ) == 1: with open( config_path, 'r' ) as f: