From f5eeba72e006c1df3e1e834f9a98ea72493d282c Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 15 May 2015 00:33:10 +0200 Subject: [PATCH] Changed evtable to use a custom ljust/rjust routine instead of the ones from the python library. This resolves issues with width calculation of strings containing MXP links. Resolves #705. --- evennia/utils/evtable.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/evennia/utils/evtable.py b/evennia/utils/evtable.py index 9dfc0f4d3f..3ef66476dd 100644 --- a/evennia/utils/evtable.py +++ b/evennia/utils/evtable.py @@ -568,11 +568,13 @@ class EvCell(object): """ align = self.align + hfill_char = self.hfill_char + width = self.width if align == "l": - return [line.ljust(self.width, self.hfill_char) for line in data] + return [line + hfill_char * (width - m_len(line)) for line in data] elif align == "r": - return [line.rjust(self.width, self.hfill_char) for line in data] - else: + return [hfill_char * (width - m_len(line)) + line for line in data] + else: # center, 'c' return [self._center(line, self.width, self.hfill_char) for line in data] def _valign(self, data):