bubbles
bubbles copied to clipboard
Viewport: truncation and wrapping options
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.
Is this the reason why SetcContent
with a very large text will make the viewport expand in height? I was under the assumption that I might have done something wrong, so I'm still looking into why the viewport won't obey the height I set. I thought that a large content will make the viewport scroll vertically.
@mrusme iirc, yes. you'll want to wrap your text with something like:
str := lipgloss.NewStyle().Width(width).Render(content)
model.SetContent(str)