From 65809feb250f4a3ad952aba192a069312e6efd15 Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Wed, 23 Feb 2022 18:49:12 +1000 Subject: [PATCH] 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. --- termstr/termstr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/termstr/termstr.py b/termstr/termstr.py index 4aedc33..4d5c9e8 100644 --- a/termstr/termstr.py +++ b/termstr/termstr.py @@ -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