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.
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):