Update dependencies (#5518)

This commit is contained in:
hongming
2023-02-12 23:09:20 +08:00
committed by GitHub
parent d3b35fb2da
commit a979342f56
1486 changed files with 126660 additions and 71128 deletions

View File

@@ -3,8 +3,9 @@ package wordwrap
import (
"bytes"
"github.com/mattn/go-runewidth"
"unicode"
"github.com/gosuri/uitable/util/strutil"
)
// WrapString wraps the given string within lim width in characters.
@@ -30,7 +31,7 @@ func WrapString(s string, lim uint) string {
} else {
current += uint(spaceWidth)
spaceBuf.WriteTo(buf)
spaceWidth += runewidth.StringWidth(buf.String())
spaceWidth += strutil.StringWidth(buf.String())
}
spaceBuf.Reset()
spaceWidth = 0
@@ -57,10 +58,10 @@ func WrapString(s string, lim uint) string {
}
spaceBuf.WriteRune(char)
spaceWidth += runewidth.RuneWidth(char)
spaceWidth += strutil.RuneWidth(char)
} else {
wordBuf.WriteRune(char)
wordWidth += runewidth.RuneWidth(char)
wordWidth += strutil.RuneWidth(char)
if current+uint(spaceWidth+wordWidth) > lim && uint(wordWidth) < lim {
buf.WriteRune('\n')