You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm learning bubbletea and lipgloss, and reading a lot of the code because I'm not finding any descriptions about the "box model" (so to speak) that explains how width, padding, border, and margins interact. In doing so, I ran across this code in lipgloss/style.go:
str=wordwrap.String(str, wrapAt)
str=wrap.String(str, wrapAt) // force-wrap long strings
If you have a series of words just longer than the limit, you will get weird, orphaned pieces. For example, wrapping 123456789 123 123456789 123 123456789 123 at length 8 using the above code, the initial wordbreak will leave the length-9 words intact, but add newlines after them, causing the short words to always be on their own lines:
I'm learning bubbletea and lipgloss, and reading a lot of the code because I'm not finding any descriptions about the "box model" (so to speak) that explains how width, padding, border, and margins interact. In doing so, I ran across this code in lipgloss/style.go:
If you have a series of words just longer than the limit, you will get weird, orphaned pieces. For example, wrapping
123456789 123 123456789 123 123456789 123
at length 8 using the above code, the initialwordbreak
will leave the length-9 words intact, but add newlines after them, causing the short words to always be on their own lines:If
wordbreak
had a "hard break if needed", the calling code would just call "wordwrap with hard-breaks", and get:Would that be useful?
The text was updated successfully, but these errors were encountered: