mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
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.
This commit is contained in:
parent
554b55c9ec
commit
f5eeba72e0
1 changed files with 5 additions and 3 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue