Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trailing newline on rendered list elements disrupts layout #10

Closed
simonmichael opened this issue Aug 20, 2015 · 1 comment
Closed

trailing newline on rendered list elements disrupts layout #10

simonmichael opened this issue Aug 20, 2015 · 1 comment

Comments

@simonmichael
Copy link
Contributor

The right-padding issue I noticed on #7 was because my rendered list elements had a trailing newline. In this situation the row ends with an ellipsis, and an enclosing element's width is disrupted on that line. Eg instead of

|                        |
|    E                   |
|                        |

you see

|                        |
|    E…|
|                        |

Perhaps it should always strip trailing newlines, I expect it will be a common mistake.

@jtdaugherty
Copy link
Owner

A while back I split up the string and text widget functions into single- and multi-line variants. I noticed that in cases where you just want to display short strings with no newlines, we were paying a performance penalty because of all of the line processing that str is doing. I was hoping that we could avoid this by having special constructors for those cases, but from this issue and from my own experience I'm now pretty sure it isn't worth the benefit since it's too easy to get this wrong.

I've removed the multiline variants in 1950bc0 so now str and txt behave as before and deal with newlines gracefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants