mirror of
https://github.com/charmbracelet/gum
synced 2024-05-25 18:02:36 +02:00
b23ebce896
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. |
||
---|---|---|
.. | ||
decode | ||
exit | ||
files | ||
log | ||
stack | ||
stdin | ||
utils |