Only wrap on actual spaces
authorJeremy Stanley <fungi@yuggoth.org>
Sat, 30 Jun 2018 20:21:58 +0000 (20:21 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Sat, 30 Jun 2018 20:29:24 +0000 (20:29 +0000)
commit695e1cdb469138ded8d9fda49a5a276327570f1c
tree2872176959760da816be276f10b4f5349f5d777a
parent61db8bcc92f53c708d10be01eb48ebf49cfb1274
Only wrap on actual spaces

Trying to match on Unicode character classes to determine where to
wrap lines turns out to be a fragile and blacklist-heavy exercise.
Instead, just wrap on actual (ASCII \x20) space characters. This
fixes a bug where the escape characters starting ANSI sequences were
sometimes matching as a wrap point garbling the output, but also
simplifies the code by no longer needing to exclude carriage returns
in a CR+LF line ending sequence. Further it solves a couple TODO
reminders to stop wrapping on non-breaking (Unicode \xa0) space
characters.
mudpy/misc.py