diff --git a/aider/coders/editblock_coder.py b/aider/coders/editblock_coder.py index 622b17043..5388bbac7 100644 --- a/aider/coders/editblock_coder.py +++ b/aider/coders/editblock_coder.py @@ -348,12 +348,14 @@ def find_original_update_blocks(content): if current_filename: filename = current_filename else: - raise ValueError(f"Bad/missing filename. It should go right above {HEAD}") + raise ValueError( + f"Bad/missing filename. It should go right above the {HEAD}" + ) except IndexError: if current_filename: filename = current_filename else: - raise ValueError(f"Bad/missing filename. It should go right above {HEAD}") + raise ValueError(f"Bad/missing filename. It should go right above the {HEAD}") current_filename = filename diff --git a/aider/coders/editblock_prompts.py b/aider/coders/editblock_prompts.py index 3874cf232..117503a41 100644 --- a/aider/coders/editblock_prompts.py +++ b/aider/coders/editblock_prompts.py @@ -32,22 +32,22 @@ some/dir/example.py >>>>>>> updated {fence[1]} -A program will parse the edit blocks you generate and replace the HEAD lines with the `updated` lines. +A program will parse the edit blocks you generate and replace the `HEAD` lines with the `updated` lines. So edit blocks must be precise and unambiguous! Every *edit block* must be fenced with {fence[0]}...{fence[1]} with the correct code language. Every *edit block* must start with the full path! *NEVER* propose edit blocks for *read-only* files. -The HEAD section must be an *exact set of sequential lines* from the file! -NEVER SKIP LINES in the HEAD section! +The `HEAD` section must be an *exact set of sequential lines* from the file! +NEVER SKIP LINES in the `HEAD` section! NEVER ELIDE LINES AND REPLACE THEM WITH A COMMENT! -NEVER OMIT ANY WHITESPACE in the HEAD section! +NEVER OMIT ANY WHITESPACE in the `HEAD` section! Edits to different parts of a file each need their own *edit block*. If you want to put code in a new file, use an edit block with: - A new file path, including dir name if needed -- An empty HEAD section +- An empty `HEAD` section - The new file's contents in the `updated` section """