mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
fix: correctly detect edit blocks in diff-fenced mode
This commit is contained in:
parent
3e0af2cc84
commit
9e54898866
1 changed files with 4 additions and 1 deletions
|
@ -454,7 +454,10 @@ def find_original_update_blocks(content, fence=DEFAULT_FENCE, valid_fnames=None)
|
||||||
"```csh",
|
"```csh",
|
||||||
"```tcsh",
|
"```tcsh",
|
||||||
]
|
]
|
||||||
next_is_editblock = i + 1 < len(lines) and head_pattern.match(lines[i + 1].strip())
|
|
||||||
|
# Check if the next line or the one after that is an editblock
|
||||||
|
next_is_editblock = (i + 1 < len(lines) and head_pattern.match(lines[i + 1].strip())
|
||||||
|
or i + 2 < len(lines) and head_pattern.match(lines[i + 2].strip()))
|
||||||
|
|
||||||
if any(line.strip().startswith(start) for start in shell_starts) and not next_is_editblock:
|
if any(line.strip().startswith(start) for start in shell_starts) and not next_is_editblock:
|
||||||
shell_content = []
|
shell_content = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue