mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-02 13:12:00 -07:00
Do not apply 'nth' attributes to trailing whitespaces
# foo bar # ----- <- previously underlined trailing whitespace # --- <- with the fix, trailing whitespace is excluded fzf --color nth:underline --nth 1 <<< 'foo bar'
This commit is contained in:
@@ -3044,7 +3044,8 @@ func (t *Terminal) printHighlighted(result Result, colBase tui.ColorPair, colMat
|
|||||||
}
|
}
|
||||||
for _, token := range tokens {
|
for _, token := range tokens {
|
||||||
start := token.prefixLength
|
start := token.prefixLength
|
||||||
end := start + int32(token.text.Length())
|
length := token.text.Length() - token.text.TrailingWhitespaces()
|
||||||
|
end := start + int32(length)
|
||||||
nthOffsets = append(nthOffsets, Offset{int32(start), int32(end)})
|
nthOffsets = append(nthOffsets, Offset{int32(start), int32(end)})
|
||||||
}
|
}
|
||||||
sort.Sort(ByOrder(nthOffsets))
|
sort.Sort(ByOrder(nthOffsets))
|
||||||
|
Reference in New Issue
Block a user