vendor: update termbox-go to fix ncdu command on FreeBSD

see https://github.com/nsf/termbox-go/commit/58d4fcbce2a7e6a3a48afbc6b7ec2a916ac33ee0
This commit is contained in:
Kuang-che Wu
2020-01-12 14:20:12 +00:00
committed by Nick Craig-Wood
parent e0d41da3e3
commit 3801b8109e
5 changed files with 26 additions and 18 deletions
+7 -6
View File
@@ -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
+11 -8
View File
@@ -2,13 +2,16 @@
package termbox
import "github.com/mattn/go-runewidth"
import "fmt"
import "os"
import "os/signal"
import "syscall"
import "runtime"
import "time"
import (
"fmt"
"os"
"os/signal"
"runtime"
"syscall"
"time"
"github.com/mattn/go-runewidth"
)
// public API
@@ -24,7 +27,7 @@ import "time"
func Init() error {
var err error
if runtime.GOOS == "openbsd" {
if runtime.GOOS == "openbsd" || runtime.GOOS == "freebsd" {
out, err = os.OpenFile("/dev/tty", os.O_RDWR, 0)
if err != nil {
return err
+2 -2
View File
@@ -120,7 +120,7 @@ github.com/mattn/go-colorable
github.com/mattn/go-ieproxy
# github.com/mattn/go-isatty v0.0.11-0.20191112051248-2a2f0ea997f9
github.com/mattn/go-isatty
# github.com/mattn/go-runewidth v0.0.6
# github.com/mattn/go-runewidth v0.0.7
github.com/mattn/go-runewidth
# github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/go-homedir
@@ -128,7 +128,7 @@ github.com/mitchellh/go-homedir
github.com/ncw/go-acd
# github.com/ncw/swift v1.0.49
github.com/ncw/swift
# github.com/nsf/termbox-go v0.0.0-20190817171036-93860e161317
# github.com/nsf/termbox-go v0.0.0-20191229070316-58d4fcbce2a7
github.com/nsf/termbox-go
# github.com/okzk/sdnotify v0.0.0-20180710141335-d9becc38acbd
github.com/okzk/sdnotify