forked from TrueCloudLab/rclone
vendor: update termbox-go to fix ncdu command on FreeBSD
see 58d4fcbce2
This commit is contained in:
parent
e0d41da3e3
commit
3801b8109e
5 changed files with 26 additions and 18 deletions
13
vendor/github.com/mattn/go-runewidth/runewidth.go
generated
vendored
13
vendor/github.com/mattn/go-runewidth/runewidth.go
generated
vendored
|
@ -102,11 +102,9 @@ func NewCondition() *Condition {
|
|||
// See http://www.unicode.org/reports/tr11/
|
||||
func (c *Condition) RuneWidth(r rune) int {
|
||||
switch {
|
||||
case r < 0 || r > 0x10FFFF ||
|
||||
inTables(r, nonprint, combining, notassigned):
|
||||
case r < 0 || r > 0x10FFFF || inTables(r, nonprint, combining, notassigned):
|
||||
return 0
|
||||
case (c.EastAsianWidth && IsAmbiguousWidth(r)) ||
|
||||
inTables(r, doublewidth, emoji):
|
||||
case (c.EastAsianWidth && IsAmbiguousWidth(r)) || inTables(r, doublewidth):
|
||||
return 2
|
||||
default:
|
||||
return 1
|
||||
|
@ -128,9 +126,12 @@ func (c *Condition) stringWidthZeroJoiner(s string) (width int) {
|
|||
}
|
||||
w := c.RuneWidth(r)
|
||||
if r2 == 0x200D && inTables(r, emoji) && inTables(r1, emoji) {
|
||||
w = 0
|
||||
if width < w {
|
||||
width = w
|
||||
}
|
||||
} else {
|
||||
width += w
|
||||
}
|
||||
width += w
|
||||
r1, r2 = r2, r
|
||||
}
|
||||
return width
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue