Formatter: Improve indents at closing tokens

This commit is contained in:
gregorni 2023-08-08 17:02:08 +02:00
parent 47b7ee8986
commit af956e9aab

View file

@ -54,8 +54,8 @@ class Format:
indent_levels += 1
elif item_as_string in CLOSING_TOKENS:
tokenized_str = tokenized_str[:-2]
indent_levels -= 1
tokenized_str = tokenized_str.strip() + "\n" + (indent_levels * " ")
if item_as_string in WHITESPACE_BEFORE:
tokenized_str = tokenized_str.strip() + " "