From 9a77b51dce1f1758c565589e7e1993f556c5c998 Mon Sep 17 00:00:00 2001 From: gregorni Date: Thu, 27 Jul 2023 15:48:39 +0200 Subject: [PATCH] formatter.py: fix newlines being indented a space too much --- blueprintcompiler/formatter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/blueprintcompiler/formatter.py b/blueprintcompiler/formatter.py index f680d94..9bc798c 100644 --- a/blueprintcompiler/formatter.py +++ b/blueprintcompiler/formatter.py @@ -43,7 +43,11 @@ class Format: if str(item) in newline_after + closing_tokens + opening_tokens: tokenized_str += "\n" tokenized_str += indent_levels * " " + else: - tokenized_str += " " + if tokenized_str == tokenized_str.strip(): + tokenized_str += " " + + print(tokenized_str) return tokenized_str