Merge branch 'main' into edit-formats

This commit is contained in:
Paul Gauthier 2023-06-23 07:54:24 -07:00
commit fc6dd1877c
2 changed files with 15 additions and 1 deletions

View file

@ -95,7 +95,7 @@ def replace_part_with_missing_leading_whitespace(whole, part, replace):
# 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((len(pline) > 0 and pline[0].isspace()) for pline in part_lines):
if all((not pline or pline[0].isspace()) for pline in part_lines):
return
for i in range(len(whole_lines) - len(part_lines) + 1):