aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattn/go-runewidth
diff options
context:
space:
mode:
authorHackyMiner <hackyminer@gmail.com>2018-09-29 22:15:39 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-09-29 22:15:39 +0800
commit44eb69561a32c1b1e5345b5872e7de69fff936c2 (patch)
tree0eefc0ded63fbf5c481b6ea845b6fdadf5a123b9 /vendor/github.com/mattn/go-runewidth
parentd9e324a331788959bb7fb7f388383b1cad4ca65b (diff)
downloadgo-tangerine-44eb69561a32c1b1e5345b5872e7de69fff936c2.tar
go-tangerine-44eb69561a32c1b1e5345b5872e7de69fff936c2.tar.gz
go-tangerine-44eb69561a32c1b1e5345b5872e7de69fff936c2.tar.bz2
go-tangerine-44eb69561a32c1b1e5345b5872e7de69fff936c2.tar.lz
go-tangerine-44eb69561a32c1b1e5345b5872e7de69fff936c2.tar.xz
go-tangerine-44eb69561a32c1b1e5345b5872e7de69fff936c2.tar.zst
go-tangerine-44eb69561a32c1b1e5345b5872e7de69fff936c2.zip
internal/debug: support color terminal for cygwin/msys2 (#17740)
- update go-colorable, go-isatty, go-runewidth packages - use go-isatty instead of log/term and remove log/term package
Diffstat (limited to 'vendor/github.com/mattn/go-runewidth')
-rw-r--r--vendor/github.com/mattn/go-runewidth/runewidth.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/vendor/github.com/mattn/go-runewidth/runewidth.go b/vendor/github.com/mattn/go-runewidth/runewidth.go
index 2164497ad..82568a1bb 100644
--- a/vendor/github.com/mattn/go-runewidth/runewidth.go
+++ b/vendor/github.com/mattn/go-runewidth/runewidth.go
@@ -1,13 +1,24 @@
package runewidth
+import "os"
+
var (
// EastAsianWidth will be set true if the current locale is CJK
- EastAsianWidth = IsEastAsian()
+ EastAsianWidth bool
// DefaultCondition is a condition in current locale
DefaultCondition = &Condition{EastAsianWidth}
)
+func init() {
+ env := os.Getenv("RUNEWIDTH_EASTASIAN")
+ if env == "" {
+ EastAsianWidth = IsEastAsian()
+ } else {
+ EastAsianWidth = env == "1"
+ }
+}
+
type interval struct {
first rune
last rune
@@ -55,6 +66,7 @@ var private = table{
var nonprint = table{
{0x0000, 0x001F}, {0x007F, 0x009F}, {0x00AD, 0x00AD},
{0x070F, 0x070F}, {0x180B, 0x180E}, {0x200B, 0x200F},
+ {0x2028, 0x2029},
{0x202A, 0x202E}, {0x206A, 0x206F}, {0xD800, 0xDFFF},
{0xFEFF, 0xFEFF}, {0xFFF9, 0xFFFB}, {0xFFFE, 0xFFFF},
}