evennia icon indicating copy to clipboard operation
evennia copied to clipboard

[BUG] Formatting on nested evtables is losing inner table formatting (or dropping space characters above the first in a sequence)

Open WillowMist opened this issue 1 year ago • 6 comments

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. image image

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

WillowMist avatar May 17 '23 17:05 WillowMist

I'm not sure nested EvTables are even a thing. Needs more investigation.

Griatch avatar Aug 06 '23 16:08 Griatch

I will say they worked before. It's how I developed character sheets for World of Darkness, and card decks for the pictured game.

WillowMist avatar Aug 07 '23 15:08 WillowMist

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.

WillowMist avatar Jun 27 '24 23:06 WillowMist

Of course formatting bites me in the butt.

image

WillowMist avatar Jun 27 '24 23:06 WillowMist

@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.

Griatch avatar Jun 28 '24 05:06 Griatch

Excellent, thank you

WillowMist avatar Jun 28 '24 16:06 WillowMist