mirror of
https://github.com/charmbracelet/gum
synced 2024-06-17 04:55:05 +02:00
There are a couple of gotchas in LipGlossTruncate: * len() returns the number of bytes in a string * slicing a string slices it on a byte level The fix would normally be to convert the string to a slice of runes and operate on that new slice: r := []rune(str) However, reflow already contains an ansi-aware truncate feature that we can use instead as a drop-in replacement for the LipGlossTruncate function. |
||
---|---|---|
.. | ||
utils.go |