-
Notifications
You must be signed in to change notification settings - Fork 264
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: truncation and wrapping options #56
Comments
Is this the reason why |
@mrusme iirc, yes. you'll want to wrap your text with something like: str := lipgloss.NewStyle().Width(width).Render(content)
model.SetContent(str) |
@meowgorithm When the length of a line exceeds the width of the terminal, the line is soft-wrapped as per your example above. However, this is affects the scrolling. Scrolling is still assuming that each content line = line in the terminal, and stops after the YOffset has been incremented to the int value, which is the difference between viewport lines and total content lines. This affects the scroll percentage as well. |
It would be nice if the viewport provided some options to automatically wrap and truncate text to keep layouts from breaking, rather than leaving this as an exercise for the user.
The most likely solution here is to take advantage of reflow.
The text was updated successfully, but these errors were encountered: