Width returns the width of the string, ignoring ANSI escape codes. Not all ANSI escape codes are supported yet.
(s string)
| 26 | // Width returns the width of the string, ignoring ANSI escape codes. |
| 27 | // Not all ANSI escape codes are supported yet. |
| 28 | func Width(s string) int { |
| 29 | return runewidth.StringWidth(cleanANSI(s)) |
| 30 | } |
| 31 | |
| 32 | // Ellipsis truncates a string to a given number of runes with an ellipsis at the end. |
| 33 | // It tries to persist the ANSI escape sequences. |
no test coverage detected
searching dependent graphs…