mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-20 15:03:49 -07:00
Make util.RuneWidth return 1 for non-displayable characters
Fix line wrapping in preview window
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user