-
Notifications
You must be signed in to change notification settings - Fork 266
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
viewport line wrapping bug #644
Comments
What a coincindence. I discovered this exact same issue while trying to diagnose a line wrapping issue in the Select widget from |
Glad to know this is actually an issue and not just a skill issue on my part, I discovered it while working on a TUI for messaging, so this is a core functionality of what I am making. |
Hi! This is not entirely a bug: historically we've left wrapping as an exercise for the user. If you need to solve this now you can simply: wrapped := lipgloss.NewStyle().Width(yourWidth).Render(yourContent)
viewport.SetContent(wrapped) That said, we're tracking this in #578. |
Describe the bug
Multi-line (wrapped) text causes the viewport to not behave correctly, when using
viewport.Model#GotoBottom()
and updating the height of it (by resizing the terminal),Instead of hiding the top messages, it behaves weirdly and hides the bottom message.
Setup
Please complete the following information along with version numbers, if applicable.
To Reproduce
Steps to reproduce the behavior:
Source Code
A slightly modified version of the example "chat" code
Expected behavior
Actual behavior
Screenshots
Normal
After shrinking once (bottom line missing, both 1st and 2nd line of the top message exist)
The expected behaviour would be to either
After shrinking again (bottom line reappears, both the 1st and 2nd line of the top message disappear)
The text was updated successfully, but these errors were encountered: