diff --git a/tools/wcswidth/wcswidth.go b/tools/wcswidth/wcswidth.go index 5d59ed3b2..1d3f40707 100644 --- a/tools/wcswidth/wcswidth.go +++ b/tools/wcswidth/wcswidth.go @@ -2,6 +2,8 @@ package wcswidth +import "kitty/tools/utils" + func IsFlagCodepoint(ch rune) bool { return 0x1F1E6 <= ch && ch <= 0x1F1FF } @@ -89,5 +91,5 @@ func (self *WCWidthIterator) Parse(b []byte) (ans int) { func Stringwidth(text string) int { w := CreateWCWidthIterator() - return w.Parse([]byte(text)) + return w.Parse(utils.UnsafeStringToBytes(text)) }