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
Describe the bug
When a string has a character with a value larger than 0x7F, it gets encoded into multiple bytes in UTF-8 encoding. When using the viewport component of bubbles, text that should fit within the width of one screen gets wrapped to the next line I suspect because it's counting bytes rather than Runes.
Expected behavior
Would expect text to fit on one line when the terminal is wide enough.
The text was updated successfully, but these errors were encountered:
cskeeters
changed the title
viewport line wrapping strings unnecessarily with UTF-8 characters
viewport wrapping strings unnecessarily with UTF-8 characters
Feb 25, 2025
cskeeters
added a commit
to cskeeters/betty-file-manager
that referenced
this issue
Feb 25, 2025
Describe the bug
When a string has a character with a value larger than 0x7F, it gets encoded into multiple bytes in UTF-8 encoding. When using the viewport component of bubbles, text that should fit within the width of one screen gets wrapped to the next line I suspect because it's counting bytes rather than Runes.
Setup
macOS Sonoma
ghostty or iterm2
locale
:To Reproduce
Run wrap
Change the width of the terminal. "B" should move to the next line only after the width of the terminal can't fit it on the same line.
Compare against behavior when string has no utf8 chars.
Source Code
main.go:
MY go.mod:
Expected behavior
Would expect text to fit on one line when the terminal is wide enough.
The text was updated successfully, but these errors were encountered: