From 618803fcc4bae649426426f2294b22bea0a29c2e Mon Sep 17 00:00:00 2001 From: Cameron Clough Date: Tue, 22 Apr 2025 20:34:27 +0100 Subject: [PATCH] make sure empty text returns 0 lines --- system/ui/text.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/ui/text.py b/system/ui/text.py index 4ea886ba1e..b0e1f21a62 100755 --- a/system/ui/text.py +++ b/system/ui/text.py @@ -21,7 +21,8 @@ def wrap_text(text, font_size, max_width): for paragraph in text.split("\n"): if not paragraph.strip(): - lines.append("") + if lines: + lines.append("") continue indent = re.match(r"^\s*", paragraph).group() current_line = indent