From 6c6c0a47782328d21cc2899ac9c9f0e6edb1fb40 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 9 Jan 2017 10:45:05 +0900 Subject: [PATCH] Make util.RuneWidth return 1 for non-displayable characters Fix line wrapping in preview window --- src/util/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/util.go b/src/util/util.go index 29e8017..15ec0ad 100644 --- a/src/util/util.go +++ b/src/util/util.go @@ -18,7 +18,7 @@ func RuneWidth(r rune, prefixWidth int, tabstop int) int { } else if w, found := _runeWidths[r]; found { return w } else { - w := runewidth.RuneWidth(r) + w := Max(runewidth.RuneWidth(r), 1) _runeWidths[r] = w return w }