From 806805c0b1571871fbd425394d67a676ad90ac84 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 10 Jun 2023 06:16:22 -0700 Subject: [PATCH] Ensure leading_whitespace is actually space --- aider/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/utils.py b/aider/utils.py index b67af7e29..3da9f3584 100644 --- a/aider/utils.py +++ b/aider/utils.py @@ -77,7 +77,7 @@ def replace_part_with_missing_leading_whitespace(whole, part, replace): leading_whitespace = whole_lines[i][:j] break - if not leading_whitespace: + if not leading_whitespace or not all(c.isspace() for c in leading_whitespace): continue matched = all(