Skip to content

Commit

Permalink
bump go-runewidth dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
philpennock committed Feb 9, 2020
1 parent ad24821 commit 09ac882
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -5,5 +5,5 @@ go 1.12
require (
// We need ExpectPanic, which came in with this commit (also currently HEAD)
github.com/liquidgecka/testlib v0.0.0-20180123051607-561e6b271c63
github.com/mattn/go-runewidth v0.0.4
github.com/mattn/go-runewidth v0.0.8
)
2 changes: 2 additions & 0 deletions go.sum
Expand Up @@ -2,3 +2,5 @@ github.com/liquidgecka/testlib v0.0.0-20180123051607-561e6b271c63 h1:E1gsAMD4Tys
github.com/liquidgecka/testlib v0.0.0-20180123051607-561e6b271c63/go.mod h1:vwMPvLIhXhkJaBfsk/6l+eDuiQaIVHC0b6eCvUVBsB0=
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.8 h1:3tS41NlGYSmhhe/8fhGRzc+z3AYCw1Fe1WAyLuujKs0=
github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
9 changes: 2 additions & 7 deletions length/length.go
Expand Up @@ -32,13 +32,8 @@ func StringRunes(s string) int {
// closer.
func StringCells(s string) int {
// FIXME: why do I not have real data here for the common case of one line?
// I'm seeing runewidth.StringWidth(s) return 0 bogusly
w := runewidth.StringWidth(s)
if w == 0 && len(s) > 0 {
// Assume it's a wide-char being mis-handled
w = 2
}
return w
// If you see a zero length, it's probably an old version of go-runewidth
return runewidth.StringWidth(s)
}

// Lines breaks a string apart into lines; a final newline in the string does
Expand Down

0 comments on commit 09ac882

Please sign in to comment.