From 2643cc8643c7363ebf947a8bf52a8a51d59d6ad3 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 23 Aug 2024 16:20:04 -0700 Subject: [PATCH] fix: Exclude "All" option and don't honor group preference when explicit_yes_required is True --- aider/io.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/aider/io.py b/aider/io.py index 2cd827828..07811f914 100644 --- a/aider/io.py +++ b/aider/io.py @@ -379,7 +379,10 @@ class InputOutput: ): self.num_user_asks += 1 - question += " (Y)es/(N)o/(A)ll/(S)kip all [Y]: " + if explicit_yes_required: + question += " (Y)es/(N)o/(S)kip all [Y]: " + else: + question += " (Y)es/(N)o/(A)ll/(S)kip all [Y]: " if subject: self.tool_output() @@ -398,11 +401,13 @@ class InputOutput: style = dict() def is_valid_response(text): - return text.lower()[0] in ["y", "n", "a", "s", ""] + valid_responses = ["y", "n", "s", ""] if explicit_yes_required else ["y", "n", "a", "s", ""] + return text.lower()[0] in valid_responses + error_message = "Please answer Yes, No, or Skip all." if explicit_yes_required else "Please answer Yes, No, All, or Skip all." validator = Validator.from_callable( is_valid_response, - error_message="Please answer Yes, No, All, or Skip all.", + error_message=error_message, move_cursor_to_end=True, ) @@ -410,7 +415,7 @@ class InputOutput: res = "n" if explicit_yes_required else "y" elif self.yes is False: res = "n" - elif group and group.preference: + elif group and group.preference and not explicit_yes_required: res = group.preference else: res = prompt( @@ -423,10 +428,10 @@ class InputOutput: res = res.lower()[0] is_yes = res in ("y", "a") - is_all = res == "a" + is_all = res == "a" and not explicit_yes_required is_skip = res == "s" - if group: + if group and not explicit_yes_required: if is_all: group.preference = "a" elif is_skip: