refactor: migrate from uniseg to displaywidth (#2559)

* migrate from uniseg to displaywidth

* use firstGraphemeCluster
This commit is contained in:
valoq authored and GitHub committed 2026-05-01 14:06:58 +10:00
1 parent 54bcbca6ce
commit a88d55e077
6 files changed
+39 -34

No files matched your search

+1 -1
View File
@@ -298,7 +298,7 @@ func sanitizeForDisplay(s string) string {
// sanitizeName sanitizes a filename, path, or symlink target for display.
// Unlike sanitizeForDisplay it also replaces tabs, because tabs in names
// are expanded by the renderer to tabstop width while uniseg.StringWidth
// are expanded by the renderer to tabstop width while displaywidth.String
// counts them as width 1, causing column overflow.
func sanitizeName(s string) string {
return strings.Map(func(r rune) rune {