mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 00:05:01 +00:00
feat: Add group parameter to confirm_ask function
This commit is contained in:
parent
16c1d21bc0
commit
1be65f9c77
1 changed files with 9 additions and 1 deletions
10
aider/io.py
10
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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue