mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
cleanup
This commit is contained in:
parent
2cd2ff6f02
commit
c596ea543b
1 changed files with 1 additions and 7 deletions
|
@ -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]
|
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]
|
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.
|
# can we find an exact match not including the leading whitespace
|
||||||
# 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
|
|
||||||
|
|
||||||
for i in range(len(whole_lines) - len(part_lines) + 1):
|
for i in range(len(whole_lines) - len(part_lines) + 1):
|
||||||
leading_whitespace = ""
|
leading_whitespace = ""
|
||||||
for j, c in enumerate(whole_lines[i]):
|
for j, c in enumerate(whole_lines[i]):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue