From 682060daaf004eee616818d1118148b9a51b8a1f Mon Sep 17 00:00:00 2001 From: Griatch Date: Mon, 14 Nov 2016 23:18:36 +0100 Subject: [PATCH] Add a lateral shift when stripping a space - the total width of the cell must not change. Relates to 1117. --- evennia/utils/evtable.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evennia/utils/evtable.py b/evennia/utils/evtable.py index 55e7a48c57..d8de04ec37 100644 --- a/evennia/utils/evtable.py +++ b/evennia/utils/evtable.py @@ -575,9 +575,9 @@ class EvCell(object): hfill_char = self.hfill_char width = self.width if align == "l": - return [(line.lstrip(" ") if line.startswith(" ") and not line.startswith(" ") else line) + hfill_char * (width - m_len(line)) for line in data] + return [(line.lstrip(" ") + " " if line.startswith(" ") and not line.startswith(" ") else line) + hfill_char * (width - m_len(line)) for line in data] elif align == "r": - return [hfill_char * (width - m_len(line)) + (line.rstrip(" ") if line.endswith(" ") and not line.endswith(" ") else line) for line in data] + return [hfill_char * (width - m_len(line)) + (" " + line.rstrip(" ") if line.endswith(" ") and not line.endswith(" ") else line) for line in data] else: # center, 'c' return [self._center(line, self.width, self.hfill_char) for line in data]