From c596ea543b8bb86e1119fb21558807ebfdff3e35 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 3 Aug 2023 14:24:54 -0300 Subject: [PATCH] cleanup --- aider/coders/editblock_coder.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/aider/coders/editblock_coder.py b/aider/coders/editblock_coder.py index aaf8a33a9..0095df97c 100644 --- a/aider/coders/editblock_coder.py +++ b/aider/coders/editblock_coder.py @@ -119,13 +119,7 @@ def replace_part_with_missing_leading_whitespace(whole, part, replace): part_lines = [p[leading:] if p.strip() else p for p in part_lines] replace_lines = [p[leading:] if p.strip() else p for p in replace_lines] - # If all lines in the part start with whitespace, then honor it. - # But GPT often outdents the part and replace blocks completely, - # thereby discarding the actual leading whitespace in the file. - if all((not pline or pline[0].isspace()) for pline in part_lines): - print("bye") - return - + # can we find an exact match not including the leading whitespace for i in range(len(whole_lines) - len(part_lines) + 1): leading_whitespace = "" for j, c in enumerate(whole_lines[i]):