Skip to content

Commit e232cbc

Browse files
authored
Merge pull request #169 from tukaelu/change-libs-to-get-rune-width
change library to get rune width
2 parents 3d12297 + 26b9255 commit e232cbc

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ require (
44
github.com/davecgh/go-spew v1.1.1 // indirect
55
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213
66
github.com/mattn/go-isatty v0.0.17 // indirect
7-
github.com/mattn/go-runewidth v0.0.14
87
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db
8+
github.com/rivo/uniseg v0.4.4
99
github.com/stretchr/testify v1.3.0
1010
golang.org/x/term v0.6.0
1111
)

go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213 h1:qGQQKEcAR99REcM
55
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw=
66
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
77
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
8-
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
9-
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
108
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ=
119
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw=
1210
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1311
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
14-
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
15-
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
12+
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
13+
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
1614
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
1715
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
1816
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=

progressbar.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"sync"
1212
"time"
1313

14-
"github.com/mattn/go-runewidth"
1514
"github.com/mitchellh/colorstring"
15+
"github.com/rivo/uniseg"
1616
"golang.org/x/term"
1717
)
1818

@@ -723,7 +723,7 @@ func getStringWidth(c config, str string, colorize bool) int {
723723
// get the amount of runes in the string instead of the
724724
// character count of the string, as some runes span multiple characters.
725725
// see https://stackoverflow.com/a/12668840/2733724
726-
stringWidth := runewidth.StringWidth(cleanString)
726+
stringWidth := uniseg.StringWidth(cleanString)
727727
return stringWidth
728728
}
729729

0 commit comments

Comments
 (0)