From b692a35398fef8d3b7d1d9bd4d0c47f1e01653c5 Mon Sep 17 00:00:00 2001 From: gregorni Date: Thu, 27 Jul 2023 21:22:35 +0200 Subject: [PATCH] Formatter: Fix newlines after child types --- blueprintcompiler/formatter.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/blueprintcompiler/formatter.py b/blueprintcompiler/formatter.py index 7070924..45cb9dd 100644 --- a/blueprintcompiler/formatter.py +++ b/blueprintcompiler/formatter.py @@ -44,7 +44,12 @@ class Format: if item_as_string in OPENING_TOKENS: split_string = tokenized_str.splitlines() - split_string.insert(-1, "") + + index = -1 + if "[" in split_string[-2] and "]" in split_string[-2]: + index = -2 + + split_string.insert(index, "") tokenized_str = "\n".join(split_string) indent_levels += 1