From 4555e36e204686b8a7fbfea7e4db06d5e34e7ce0 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 22 Aug 2024 09:26:50 -0700 Subject: [PATCH] do not treat editblocks as shell commands --- aider/coders/editblock_coder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/coders/editblock_coder.py b/aider/coders/editblock_coder.py index d12b2a34c..d6a3b5420 100644 --- a/aider/coders/editblock_coder.py +++ b/aider/coders/editblock_coder.py @@ -459,7 +459,9 @@ def find_original_update_blocks(content, fence=DEFAULT_FENCE): "```csh", "```tcsh", ] - if any(line.strip().startswith(start) for start in shell_starts): + next_is_editblock = i + 1 < len(lines) and lines[i + 1].rstrip() == HEAD + + if any(line.strip().startswith(start) for start in shell_starts) and not next_is_editblock: shell_content = [] i += 1 while i < len(lines) and not lines[i].strip().startswith("```"):