Skip to content
Snippets Groups Projects
Unverified Commit 6c6c0a47 authored by Junegunn Choi's avatar Junegunn Choi
Browse files

Make util.RuneWidth return 1 for non-displayable characters

Fix line wrapping in preview window
parent a16d8f66
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ func RuneWidth(r rune, prefixWidth int, tabstop int) int { ...@@ -18,7 +18,7 @@ func RuneWidth(r rune, prefixWidth int, tabstop int) int {
} else if w, found := _runeWidths[r]; found { } else if w, found := _runeWidths[r]; found {
return w return w
} else { } else {
w := runewidth.RuneWidth(r) w := Max(runewidth.RuneWidth(r), 1)
_runeWidths[r] = w _runeWidths[r] = w
return w return w
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment