From 1be65f9c774a03b41da9ae90a402cb979b030e35 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 23 Aug 2024 16:18:52 -0700 Subject: [PATCH] feat: Add group parameter to confirm_ask function --- aider/io.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/aider/io.py b/aider/io.py index 8916c4e26..6f33323a9 100644 --- a/aider/io.py +++ b/aider/io.py @@ -376,7 +376,7 @@ class InputOutput: hist = "\n" + content.strip() + "\n\n" self.append_chat_history(hist) - def confirm_ask(self, question, default="y", subject=None, explicit_yes_required=False): + def confirm_ask(self, question, default="y", subject=None, explicit_yes_required=False, group=None): self.num_user_asks += 1 question += " (Y)es/(N)o/(A)ll/(S)kip all [Y]: " @@ -410,6 +410,8 @@ class InputOutput: res = "n" if explicit_yes_required else "y" elif self.yes is False: res = "n" + elif group and group.preference: + res = group.preference else: res = prompt( question, @@ -424,6 +426,12 @@ class InputOutput: is_all = res == "a" is_skip = res == "s" + if group: + if is_all: + group.preference = "a" + elif is_skip: + group.preference = "s" + hist = f"{question.strip()} {res}" self.append_chat_history(hist, linebreak=True, blockquote=True)