mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 16:25:00 +00:00
refactor: handle updated edits array returned from apply_edits
This commit is contained in:
parent
f9604633e6
commit
7553104433
2 changed files with 4 additions and 3 deletions
|
@ -1813,9 +1813,10 @@ class Coder:
|
|||
edits = self.get_edits()
|
||||
edits = self.prepare_to_edit(edits)
|
||||
|
||||
# ai: handle the case where apply_edits returns an updated edits array (it may just return None, meaning use the existing edits array)!
|
||||
updated_edits = self.apply_edits(edits)
|
||||
if updated_edits is not None:
|
||||
edits = updated_edits
|
||||
edited = set(edit[0] for edit in edits)
|
||||
self.apply_edits(edits)
|
||||
except ValueError as err:
|
||||
self.num_malformed_responses += 1
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ class EditBlockCoder(Coder):
|
|||
failed.append(edit)
|
||||
|
||||
if not failed:
|
||||
return # ai: return the updated list of edits
|
||||
return passed
|
||||
|
||||
blocks = "block" if len(failed) == 1 else "blocks"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue