2
0
mirror of https://github.com/junegunn/fzf synced 2024-11-10 13:10:44 +00:00

Make util.RuneWidth return 1 for non-displayable characters

Fix line wrapping in preview window
This commit is contained in:
Junegunn Choi 2017-01-09 10:45:05 +09:00
parent a16d8f66a9
commit 6c6c0a4778
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

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