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

Option to drop the rest of a line instead of wrapping #135

Open
j0ru opened this issue Feb 18, 2023 · 2 comments
Open

Option to drop the rest of a line instead of wrapping #135

j0ru opened this issue Feb 18, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@j0ru
Copy link

j0ru commented Feb 18, 2023

This would be useful for apps that only want to show a preview of the full text or only expect to have to display a single line, like idk. a program launcher ^^

This could be shoehorned into the WrapStyle as an Drop option with an optional suffix, i.e. Drop(Some("…"))

Thanks for the great library, have been using confidently it for a while now

@mooman219
Copy link
Owner

I could add a WrapStyle::Abort or something that stops performing if we encounter a line break?

@mooman219 mooman219 added the enhancement New feature or request label Feb 20, 2023
@j0ru
Copy link
Author

j0ru commented Feb 20, 2023

Ah, I should have clarified. I mean when the max_width is exceeded. So instead of wrapping to a new line, the rest of the input is dropped

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

No branches or pull requests

2 participants