From f7f64d6cc1a26a7de906b0fdcceddde9c981d588 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 21 Aug 2024 09:14:44 -0700 Subject: [PATCH] feat: Add support for alternative HEAD/DIVIDER/DIVIDER format in S/R blocks --- aider/coders/editblock_coder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aider/coders/editblock_coder.py b/aider/coders/editblock_coder.py index 35093f6d8..4f27d2977 100644 --- a/aider/coders/editblock_coder.py +++ b/aider/coders/editblock_coder.py @@ -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)