diff --git a/vendor.mod b/vendor.mod index 2207bb3d1f70..d6db4d6bb5f4 100644 --- a/vendor.mod +++ b/vendor.mod @@ -28,7 +28,7 @@ require ( github.com/google/go-cmp v0.7.0 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/google/uuid v1.6.0 - github.com/mattn/go-runewidth v0.0.21 + github.com/mattn/go-runewidth v0.0.22 github.com/moby/go-archive v0.2.0 github.com/moby/moby/api v1.54.1-0.20260403102726-ef0a1e449505 github.com/moby/moby/client v0.3.1-0.20260403102726-ef0a1e449505 diff --git a/vendor.sum b/vendor.sum index 7596b371d96a..7771c0e19e2c 100644 --- a/vendor.sum +++ b/vendor.sum @@ -106,8 +106,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/mattn/go-runewidth v0.0.21 h1:jJKAZiQH+2mIinzCJIaIG9Be1+0NR+5sz/lYEEjdM8w= -github.com/mattn/go-runewidth v0.0.21/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= +github.com/mattn/go-runewidth v0.0.22 h1:76lXsPn6FyHtTY+jt2fTTvsMUCZq1k0qwRsAMuxzKAk= +github.com/mattn/go-runewidth v0.0.22/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= diff --git a/vendor/github.com/mattn/go-runewidth/runewidth.go b/vendor/github.com/mattn/go-runewidth/runewidth.go index a8c9c1fb1076..9cfd99c0571b 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth.go @@ -3,6 +3,7 @@ package runewidth import ( "os" "strings" + "unicode/utf8" "github.com/clipperhouse/uax29/v2/graphemes" ) @@ -178,6 +179,12 @@ func (c *Condition) CreateLUT() { // StringWidth return width as you can see func (c *Condition) StringWidth(s string) (width int) { + if len(s) > 0 && len(s) <= utf8.UTFMax { + r, size := utf8.DecodeRuneInString(s) + if size == len(s) { + return c.RuneWidth(r) + } + } g := graphemes.FromString(s) for g.Next() { var chWidth int diff --git a/vendor/modules.txt b/vendor/modules.txt index f83e14495049..5af0d1908411 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -156,7 +156,7 @@ github.com/klauspost/compress/internal/le github.com/klauspost/compress/internal/snapref github.com/klauspost/compress/zstd github.com/klauspost/compress/zstd/internal/xxhash -# github.com/mattn/go-runewidth v0.0.21 +# github.com/mattn/go-runewidth v0.0.22 ## explicit; go 1.20 github.com/mattn/go-runewidth # github.com/moby/docker-image-spec v1.3.1