diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index c8afd69a1..d5159544c 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1055,8 +1055,16 @@ class Coder: else: language = "the same language they are using" + if self.fence[0] == "`" * 4: + quad_backtick_reminder = ( + "\nIMPORTANT: Use *quadruple* backticks ```` as fences, not triple backticks!\n" + ) + else: + quad_backtick_reminder = "" + prompt = prompt.format( fence=self.fence, + quad_backtick_reminder=quad_backtick_reminder, lazy_prompt=lazy_prompt, platform=platform_text, shell_cmd_prompt=shell_cmd_prompt, diff --git a/aider/coders/editblock_prompts.py b/aider/coders/editblock_prompts.py index 340b1abd5..d183b0ab5 100644 --- a/aider/coders/editblock_prompts.py +++ b/aider/coders/editblock_prompts.py @@ -157,7 +157,7 @@ Every *SEARCH/REPLACE block* must use this format: 8. The closing fence: {fence[1]} Use the *FULL* file path, as shown to you by the user. - +{quad_backtick_reminder} Every *SEARCH* section must *EXACTLY MATCH* the existing file content, character for character, including all comments, docstrings, etc. If the file contains code or other data wrapped/escaped in json/xml/quotes or other containers, you need to propose edits to the literal contents of the file, including the container markup.