aboutsummaryrefslogtreecommitdiffstats
path: root/util/text/text.go
diff options
context:
space:
mode:
Diffstat (limited to 'util/text/text.go')
-rw-r--r--util/text/text.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/util/text/text.go b/util/text/text.go
index e7ef4e47..f77fa0e2 100644
--- a/util/text/text.go
+++ b/util/text/text.go
@@ -6,6 +6,13 @@ import (
"unicode/utf8"
)
+// Force runewidth not to treat ambiguous runes as wide chars, so that things
+// like unicode ellipsis/up/down/left/right glyphs can have correct runewidth
+// and can be displayed correctly in terminals.
+func init() {
+ runewidth.DefaultCondition.EastAsianWidth = false
+}
+
// Wrap a text for an exact line size
// Handle properly terminal color escape code
func Wrap(text string, lineWidth int) (string, int) {