mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +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
|
path, original, updated = edit
|
||||||
full_path = self.abs_root_path(path)
|
full_path = self.abs_root_path(path)
|
||||||
content = self.io.read_text(full_path)
|
content = self.io.read_text(full_path)
|
||||||
content = do_replace(full_path, content, original, updated, self.fence)
|
new_content = do_replace(full_path, content, original, updated, self.fence)
|
||||||
if content:
|
if not new_content:
|
||||||
self.io.write_text(full_path, 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)
|
passed.append(edit)
|
||||||
else:
|
else:
|
||||||
failed.append(edit)
|
failed.append(edit)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue