mirror of
https://github.com/charmbracelet/gum.git
synced 2024-10-26 07:10:39 +03: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. |
||
---|---|---|
.. | ||
command.go | ||
options.go | ||
pager.go | ||
search.go |