Skip to content

Commit

Permalink
Adapted to short-notice change in rivo/uniseg.
Browse files Browse the repository at this point in the history
  • Loading branch information
rivo committed Jul 28, 2022
1 parent 835809f commit a8413cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/mattn/go-runewidth

go 1.9

require github.com/rivo/uniseg v0.3.0
require github.com/rivo/uniseg v0.3.1
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/rivo/uniseg v0.3.0 h1:eyC18g7xB83Dv/xlJXLgNkRidVoR7nqFZBJvqo/K188=
github.com/rivo/uniseg v0.3.0/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rivo/uniseg v0.3.1 h1:SDPP7SHNl1L7KrEFCSJslJ/DM9DT02Nq2C61XrfHMmk=
github.com/rivo/uniseg v0.3.1/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
4 changes: 2 additions & 2 deletions runewidth.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (c *Condition) StringWidth(s string) (width int) {
var cl string
for len(s) > 0 {
var chWidth int
cl, s, state = uniseg.FirstGraphemeClusterInString(s, state)
cl, s, _, state = uniseg.FirstGraphemeClusterInString(s, state)
for _, r := range cl {
chWidth = c.RuneWidth(r)
if chWidth > 0 {
Expand All @@ -203,7 +203,7 @@ func (c *Condition) Truncate(s string, w int, tail string) string {
ch string
chWidth int
)
ch, substr, state = uniseg.FirstGraphemeClusterInString(substr, state)
ch, substr, _, state = uniseg.FirstGraphemeClusterInString(substr, state)
for _, r := range ch {
chWidth = c.RuneWidth(r)
if chWidth > 0 {
Expand Down

0 comments on commit a8413cf

Please sign in to comment.