termstr: Termstrs can be constructed from strings containing tabs.

- The tab expansion happens after the padding so that the tab stops
  are correctly aligned even with wide chars.
This commit is contained in:
Andrew Hamilton 2022-02-23 18:49:12 +10:00
parent 284f1ba8cd
commit 65809feb25

View file

@ -181,7 +181,7 @@ class TermStr(collections.UserString):
try:
self.data, self.style = data.data, data.style
except AttributeError:
self.data = _pad_wide_chars(data)
self.data = _pad_wide_chars(data).expandtabs()
self.style = (style,) * len(self.data)
@classmethod