From 0c05e3d9571d0b36ed8aa149e2282d950942d33f Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sun, 14 May 2023 11:07:22 -0700 Subject: [PATCH] Handle case where part="" and replace is non-empty --- aider/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aider/utils.py b/aider/utils.py index cea830726..ab977f079 100644 --- a/aider/utils.py +++ b/aider/utils.py @@ -44,6 +44,12 @@ def try_dotdotdots(whole, part, replace): if not part and not replace: continue + if not part and replace: + if not whole.endswith("\n"): + whole += "\n" + whole += replace + continue + if part not in whole: raise ValueError("No perfect matching chunk in edit block with ...")