Skip to content

Commit

Permalink
Fix: fix color max length in wrap string
Browse files Browse the repository at this point in the history
Signed-off-by: FogDong <[email protected]>
FogDong committed Apr 8, 2022
1 parent 798a6a6 commit 92e11e7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions util/wordwrap/wordwrap.go
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ func WrapString(s string, lim uint) string {
var wordBuf, spaceBuf bytes.Buffer
var wordWidth, spaceWidth int

lim = lim + uint(len(s)) - uint(strutil.StringWidth(s))
for _, char := range s {
if char == '\n' {
if wordBuf.Len() == 0 {

0 comments on commit 92e11e7

Please sign in to comment.