evennia
evennia copied to clipboard
[BUG] Formatting on nested evtables is losing inner table formatting (or dropping space characters above the first in a sequence)
Describe the bug
Formatting on nested evtables is losing inner table formatting.
To Reproduce
Steps to reproduce the behavior:
First image below is a single evtable displayed. Second is the same evtable, nested inside another. Boxes represent inner tables.
Expected behavior
Formatting and multiple spacing should be the same as in the solitary table.
Environment, Evennia version, OS etc
Evennia 1.3.0 (rev 89561b37f0) running on Ubuntu server 20.04
I'm not sure nested EvTables are even a thing. Needs more investigation.
I will say they worked before. It's how I developed character sheets for World of Darkness, and card decks for the pictured game.
Ok, so here's how I recreated it:
def simple_nested_table():
content = [evtable.EvColumn(align='r'),evtable.EvColumn(align='l')]
content[0].add_rows('Item 1')
content[0].add_rows('Item 2')
content[1].add_rows('Item 3')
content[1].add_rows('Item 4')
left_table = evtable.EvTable(table=content, border='cells', header=False, width=24, align='l')
right_table = evtable.EvTable(table=content, border='cells', header=False, width=24, align='r')
return left_table
# return evtable.EvTable(table=[[left_table],[right_table]], border='incols', width=55, align='c')
Running this, you get a properly formatted EvTable. Comment out the first return and uncomment the second, and it chews up the whitespace on the internal tables.
Of course formatting bites me in the butt.
@WillowMist Thanks!
I took the liberty of correcting your markdown formatting (check how how it should look by starting to edit your post). I have written a summary to Markdown formatting here if you are interested.
Excellent, thank you