Skip to content
Myr

Fix incorrect truncation of --info-command with --info=inline-right

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix #4479

authored by Junegunn Choi · committed by Junegunn Choi · parent e5cd7f0 · Browse files · 2 files+6 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−1 removed

  • tests:+5 added−0 removed
  • other:+1 added−1 removed

2 files+6 added−1 removed

modified:src/terminal.go+1 added-1 removed
1392 unmodified lines
1393 ellipsisWidth := 01394 if !fill {1395 ellipsis, ellipsisWidth = util.Truncate(t.ellipsis, limit)1396 }1397 if length > limit-ellipsisWidth {1397 if length > limit {1398 trimmedRunes, _ := t.trimRight(runes, limit-ellipsisWidth)1399 window.CPrint(*color, string(trimmedRunes)+string(ellipsis))1400 } else if fill {1401 window.CPrint(*color, util.RepeatToFill(text, length, limit))
5612 unmodified lines
modified:test/test_core.rb+5 added
1413 unmodified lines
1414 tmux.send_keys(%(seq 10000 | #{FZF} --info-command 'echo -e "--\\x1b[33m$FZF_POS\\x1b[m/$FZF_INFO--"' --info inline-right), :Enter)1415 tmux.until { assert_match(%r{ --1/10000/10000-- *$}, it[-1]) }1416 end14171418 def test_info_command_inline_right_no_ansi1419 tmux.send_keys(%(seq 10000 | #{FZF} --info-command 'echo -e "--$FZF_POS/$FZF_INFO--"' --info inline-right), :Enter)1420 tmux.until { assert_match(%r{ --1/10000/10000-- *$}, it[-1]) }1421 end14221423 def test_info_command_and_focus1424 tmux.send_keys(%(seq 100 | #{FZF} --separator x --info-command 'echo $FZF_POS' --bind focus:clear-query), :Enter)1425 tmux.until { assert_match(/^ 1 xx/, it[-2]) }1426 tmux.send_keys :Up
642 unmodified lines