From 53534d08b0573bb3302d6261dfa08d2ec8ae7790 Mon Sep 17 00:00:00 2001 From: gregorni Date: Mon, 18 Sep 2023 16:43:24 +0200 Subject: [PATCH] formatter.py: Use prev_line_type more often --- blueprintcompiler/formatter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blueprintcompiler/formatter.py b/blueprintcompiler/formatter.py index 0858676..24d900e 100644 --- a/blueprintcompiler/formatter.py +++ b/blueprintcompiler/formatter.py @@ -87,7 +87,7 @@ class Format: if two_newlines: 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 @@ -140,7 +140,7 @@ class Format: not ( prev_line_type in [LineType.CHILD_TYPE, LineType.COMMENT] - or last_added_char in OPENING_TOKENS + or prev_line_type == LineType.BLOCK_OPEN ), LineType.BLOCK_OPEN, )