mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
try patching any of the other files in the chat
This commit is contained in:
parent
5ec441dd2c
commit
785259b59c
1 changed files with 11 additions and 3 deletions
|
@ -30,9 +30,17 @@ class EditBlockCoder(Coder):
|
|||
path, original, updated = edit
|
||||
full_path = self.abs_root_path(path)
|
||||
content = self.io.read_text(full_path)
|
||||
content = do_replace(full_path, content, original, updated, self.fence)
|
||||
if content:
|
||||
self.io.write_text(full_path, content)
|
||||
new_content = do_replace(full_path, content, original, updated, self.fence)
|
||||
if not new_content:
|
||||
# try patching any of the other files in the chat
|
||||
for full_path in self.abs_fnames:
|
||||
content = self.io.read_text(full_path)
|
||||
new_content = do_replace(full_path, content, original, updated, self.fence)
|
||||
if new_content:
|
||||
break
|
||||
|
||||
if new_content:
|
||||
self.io.write_text(full_path, new_content)
|
||||
passed.append(edit)
|
||||
else:
|
||||
failed.append(edit)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue