From 49937b5dd57340383cccd6edf5e162f9d451ae30 Mon Sep 17 00:00:00 2001 From: gregorni Date: Thu, 28 Sep 2023 17:54:29 +0200 Subject: [PATCH] Revert "formatter.py: Remove `another_newline()`" This reverts commit dbcc094fc156629b798db27074b40cb9b718d9d9. --- blueprintcompiler/formatter.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/blueprintcompiler/formatter.py b/blueprintcompiler/formatter.py index 7106261..52ee2cb 100644 --- a/blueprintcompiler/formatter.py +++ b/blueprintcompiler/formatter.py @@ -127,16 +127,14 @@ class Format: prev_line_type in [LineType.CHILD_TYPE, LineType.COMMENT] or prev_line_type == LineType.BLOCK_OPEN ): - # end_str = ( - # end_str.strip() - # + "\n\n" - # + (indent_item * (indent_levels - 1)) - # ) - commit_current_line(LineType.BLOCK_OPEN, True, 2) - else: - commit_current_line( - LineType.BLOCK_OPEN, + end_str = ( + end_str.strip() + + "\n\n" + + (indent_item * (indent_levels - 1)) ) + commit_current_line( + LineType.BLOCK_OPEN, + ) elif str_item == "]" and is_child_type: commit_current_line(