mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
better handle malformed file block
This commit is contained in:
parent
2f5f8561b5
commit
8abff61aff
1 changed files with 10 additions and 5 deletions
|
@ -474,10 +474,12 @@ class Coder:
|
|||
continue
|
||||
|
||||
if self.pretty:
|
||||
if self.main_model == Models.GPT35:
|
||||
show_resp = self.update_files_gpt35(self.resp, just_diffs=True)
|
||||
else:
|
||||
show_resp = self.resp
|
||||
if self.main_model == Models.GPT35:
|
||||
try:
|
||||
show_resp = self.update_files_gpt35(self.resp, just_diffs=True)
|
||||
except ValueError:
|
||||
pass
|
||||
md = Markdown(show_resp, style="blue", code_theme="default")
|
||||
live.update(md)
|
||||
else:
|
||||
|
@ -530,6 +532,9 @@ class Coder:
|
|||
|
||||
fname = lines[i - 1].strip()
|
||||
if fname not in chat_files:
|
||||
if len(chat_files) == 1:
|
||||
fname = list(chat_files)[0]
|
||||
else:
|
||||
show_chat_files = " ".join(chat_files)
|
||||
raise ValueError(f"{fname} is not one of: {show_chat_files}")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue