mirror of
https://github.com/junegunn/fzf.git
synced 2025-05-19 04:40:22 -07:00
Truncate wrap sign in the list section if necessary
This commit is contained in:
parent
3347d61591
commit
7d26eca5cc
@ -3099,8 +3099,15 @@ func (t *Terminal) printHighlighted(result Result, colBase tui.ColorPair, colMat
|
||||
maxWidth := t.window.Width() - (indentSize + 1)
|
||||
wasWrapped := false
|
||||
if wrapped {
|
||||
wrapSign := t.wrapSign
|
||||
if maxWidth < t.wrapSignWidth {
|
||||
runes, _ := util.Truncate(wrapSign, maxWidth)
|
||||
wrapSign = string(runes)
|
||||
maxWidth = 0
|
||||
} else {
|
||||
maxWidth -= t.wrapSignWidth
|
||||
t.window.CPrint(colBase.WithAttr(tui.Dim), t.wrapSign)
|
||||
}
|
||||
t.window.CPrint(colBase.WithAttr(tui.Dim), wrapSign)
|
||||
wrapped = false
|
||||
wasWrapped = true
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user