-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Currently, any ANSI escape sequences in node.name are considered in the width of the printed form of name.
This makes the tree line connections incorrect, and everything looks wrong.
I've managed to work around this via rendering to a string first (#9) and then simply using str.replace to replace the node name with the ANSI-decorated name, but this is very slow when the number of nodes is high.
It would be nice if, instead of or in addition to using len(name):
Line 54 in db4c2f2
| next_indent = '{0}{1}{2}'.format(indent, ' ' if 'up' in last else '│', ' ' * len(name_getter(current_node))) |
That there could also be a length_getter in addition to name_getter (which, of course, defaults to len(name))
Metadata
Metadata
Assignees
Labels
No labels