|
|
@@ -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
|