1
0
mirror of https://github.com/Morantron/tmux-fingers.git synced 2024-06-26 07:29:11 +02:00

safely chop highlight

This commit is contained in:
Jorge Morante 2022-04-22 15:48:53 +02:00
parent 31f7b6141e
commit a0971e7a0d

View File

@ -58,9 +58,9 @@ class ::Fingers::MatchFormatter
def chop_highlight(hint, highlight)
if hint_position == 'right'
highlight[0..-(hint.length + 1)]
highlight[0..-(hint.length + 1)] || ""
else
highlight[hint.length..-1]
highlight[hint.length..-1] || ""
end
end
end