enforce a min similarity to do the edit

This commit is contained in:
Paul Gauthier 2023-05-08 22:42:16 -07:00
parent 7138649bd9
commit 551cc011aa

View file

@ -428,6 +428,8 @@ class Coder:
new_content = after_text new_content = after_text
else: else:
new_content = replace_most_similar_chunk(content, before_text, after_text) new_content = replace_most_similar_chunk(content, before_text, after_text)
if not new_content:
return
fname.write_text(new_content) fname.write_text(new_content)
self.console.print(f"[red]Applied edit to {fname}") self.console.print(f"[red]Applied edit to {fname}")