diff options
| author | historia <[not public]> | 2026-06-21 03:46:25 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-21 03:46:25 -0400 |
| commit | 84072ffe6365ad57c4976e9272762aa6db41de7e (patch) | |
| tree | d911389fd91e129871c23ec539e67a2666d9f78a /internal/color/color.go | |
| parent | e4bc2de6e6aa507044a6a75b4c1954974539a857 (diff) | |
| download | thehouseoficarus-84072ffe6365ad57c4976e9272762aa6db41de7e.tar.gz | |
feat: better score output
Diffstat (limited to 'internal/color/color.go')
| -rw-r--r-- | internal/color/color.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/color/color.go b/internal/color/color.go index 58c040c..dcbb280 100644 --- a/internal/color/color.go +++ b/internal/color/color.go @@ -6,6 +6,7 @@ import ( "regexp" "strconv" "strings" + "unicode/utf8" ) const Reset = "\033[0m" @@ -176,7 +177,7 @@ func StyleCode(name string) string { } func VisibleLen(s string) int { - return len(ansiRe.ReplaceAllString(s, "")) + return utf8.RuneCountInString(ansiRe.ReplaceAllString(s, "")) } func ContrastFg(mode string, bgIndex int) string { |
