From 3aa6cd99049c53493abb9a471bc5afc7e39f1860 Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Fri, 22 Mar 2024 20:54:30 +0100 Subject: [PATCH] Fixed another bug in MultilineText. --- pg.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pg.py b/pg.py index 71ddfbd..3db3a17 100644 --- a/pg.py +++ b/pg.py @@ -281,7 +281,6 @@ class MultilineText: for char in self.text: if char == "\n": lines.append(line) - line = char length = 1 else: @@ -293,9 +292,11 @@ class MultilineText: for char in self.text: if char == "\n" or len(line) + 1 > self.max_width: lines.append(line) - line = char length = 1 + if not char == "\n": + line = char + else: line += char