Procházet zdrojové kódy

Get latest revision "github.com/mattn/go-runewidth"

xormplus před 7 roky
rodič
revize
4c9129baff
1 změnil soubory, kde provedl 12 přidání a 1 odebrání
  1. 12 1
      vendor/github.com/mattn/go-runewidth/runewidth.go

+ 12 - 1
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