mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
formatter.py: Use prev_line_type more often
This commit is contained in:
parent
1e0251fcce
commit
53534d08b0
1 changed files with 2 additions and 2 deletions
|
@ -87,7 +87,7 @@ class Format:
|
||||||
|
|
||||||
if two_newlines:
|
if two_newlines:
|
||||||
another_newline(
|
another_newline(
|
||||||
not (current_line[-1] == ";" and last_added_char in CLOSING_TOKENS)
|
not (current_line[-1] == ";" and prev_line_type == LineType.BLOCK_CLOSE)
|
||||||
)
|
)
|
||||||
|
|
||||||
end_str += current_line + whitespace_to_add
|
end_str += current_line + whitespace_to_add
|
||||||
|
@ -140,7 +140,7 @@ class Format:
|
||||||
not (
|
not (
|
||||||
prev_line_type
|
prev_line_type
|
||||||
in [LineType.CHILD_TYPE, LineType.COMMENT]
|
in [LineType.CHILD_TYPE, LineType.COMMENT]
|
||||||
or last_added_char in OPENING_TOKENS
|
or prev_line_type == LineType.BLOCK_OPEN
|
||||||
),
|
),
|
||||||
LineType.BLOCK_OPEN,
|
LineType.BLOCK_OPEN,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue