mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
feat: Add support for alternative HEAD/DIVIDER/DIVIDER format in S/R blocks
This commit is contained in:
parent
9fe3d88bcb
commit
f7f64d6cc1
1 changed files with 3 additions and 3 deletions
|
@ -472,12 +472,12 @@ def find_original_update_blocks(content, fence=DEFAULT_FENCE):
|
|||
|
||||
updated_text = []
|
||||
i += 1
|
||||
while i < len(lines) and not lines[i].strip() == UPDATED:
|
||||
while i < len(lines) and not lines[i].strip() in (UPDATED, DIVIDER):
|
||||
updated_text.append(lines[i])
|
||||
i += 1
|
||||
|
||||
if i >= len(lines) or lines[i].strip() != UPDATED:
|
||||
raise ValueError(f"Expected `{UPDATED}`")
|
||||
if i >= len(lines) or lines[i].strip() not in (UPDATED, DIVIDER):
|
||||
raise ValueError(f"Expected `{UPDATED}` or `{DIVIDER}`")
|
||||
|
||||
yield filename, "".join(original_text), "".join(updated_text)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue