|
@@ -7,6 +7,7 @@ import (
|
|
"golang.org/x/text/width"
|
|
"golang.org/x/text/width"
|
|
)
|
|
)
|
|
|
|
|
|
|
|
+// https://siongui.github.io/2016/03/23/go-utf8-string-width/
|
|
func UnicodeWidth(r rune) int {
|
|
func UnicodeWidth(r rune) int {
|
|
p := width.LookupRune(r)
|
|
p := width.LookupRune(r)
|
|
if p.Kind() == width.EastAsianWide {
|
|
if p.Kind() == width.EastAsianWide {
|