mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14:59 +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 = []
|
updated_text = []
|
||||||
i += 1
|
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])
|
updated_text.append(lines[i])
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
if i >= len(lines) or lines[i].strip() != UPDATED:
|
if i >= len(lines) or lines[i].strip() not in (UPDATED, DIVIDER):
|
||||||
raise ValueError(f"Expected `{UPDATED}`")
|
raise ValueError(f"Expected `{UPDATED}` or `{DIVIDER}`")
|
||||||
|
|
||||||
yield filename, "".join(original_text), "".join(updated_text)
|
yield filename, "".join(original_text), "".join(updated_text)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue