From 551cc011aa88d26fc533880fdfe1f94e6f785deb Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 8 May 2023 22:42:16 -0700 Subject: [PATCH] enforce a min similarity to do the edit --- coder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coder.py b/coder.py index b3ef65f97..d1b868509 100755 --- a/coder.py +++ b/coder.py @@ -428,6 +428,8 @@ class Coder: new_content = after_text else: new_content = replace_most_similar_chunk(content, before_text, after_text) + if not new_content: + return fname.write_text(new_content) self.console.print(f"[red]Applied edit to {fname}")