From: Simon Tatham Date: Sun, 10 Dec 2023 22:46:02 +0000 (+0000) Subject: Second thoughts, remove that assertion again. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=01b38afd293b05726b5b6cc8e9251d31604a6bc8;p=mastodonochrome.git Second thoughts, remove that assertion again. Turns out that Composer does want to keep the entire editor buffer in a ColouredString so that it can colourise it as a whole. And that can include \n. We do want to keep \n away from add_wch, but keeping it out of ColouredString entirely isn't a workable approach. Oh well. The immediate crash is fixed, at least. --- diff --git a/text.py b/text.py index 57a4d27..42f70d0 100644 --- a/text.py +++ b/text.py @@ -51,7 +51,6 @@ class ColouredString: assert len(colour) == 1, "Colour ids are single characters" colour = colour * len(string) self.s, self.c = string, colour - assert '\n' not in self.s, "Newlines ought to be handled elsewhere" self.width = cached_wcswidth(self.s) def __add__(self, rhs):