diff --git a/coder.py b/coder.py index cc86ea4a0..48904ae9e 100755 --- a/coder.py +++ b/coder.py @@ -401,10 +401,9 @@ class Coder: self.fnames[path] = 0 edited.add(path) - if self.do_replace(path, original, updated): - continue - edit = match.group() - self.do_gpt_powered_replace(path, edit, inp) + self.do_replace(path, original, updated) + # edit = match.group() + # self.do_gpt_powered_replace(path, edit, inp) return edited @@ -427,6 +426,7 @@ class Coder: else: new_content = replace_most_similar_chunk(content, before_text, after_text) if not new_content: + self.console.print(f"[red]Failed to apply edit to {fname}") return fname.write_text(new_content) diff --git a/prompts.py b/prompts.py index 616eeaa5e..2ed18ba6b 100644 --- a/prompts.py +++ b/prompts.py @@ -53,7 +53,7 @@ EVERY ORIGINAL/UPDATED BLOCK MUST BE TRIPLE QUOTED! THE ORIGINAL BLOCK MUST BE THE *EXACT* LINES FROM THE FILE. IT *MUST* INCLUDE: - ALL THE COMMENTS IN THE ORIGINAL FILE. - - ALL THE BLANK LINES IN THE ORIGINAL FILE. + - ALL THE CONSECUTIVE LINES IN THE ORIGINAL FILE, INCLUDING BLANK OR IRRELEVANT LINES. - ALL THE ORIGINAL LEADING SPACES AND INDENTATION! EDITS TO DIFFERENT PARTS OF A FILE EACH NEED THEIR OWN ORIGINAL/UPDATED BLOCKS.