Skip to content
Myr

Fix --info-command when focus event is bound

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

Fix #4198

authored by Junegunn Choi · committed by Junegunn Choi · parent 06547d0 · Browse files · 2 files+10 added−0 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+10 added−0 removed

  • tests:+7 added−0 removed
  • other:+3 added−0 removed

2 files+10 added−0 removed

modified:src/terminal.go+3 added
4676 unmodified lines
46774678 if onFocus, prs := t.keymap[tui.Focus.AsEvent()]; prs && iter < maxFocusEvents {4679 if newIndex := t.currentIndex(); newIndex != currentIndex {4680 t.lastFocus = newIndex4681 if t.infoCommand != "" {4682 req(reqInfo)4683 }4684 actions = onFocus4685 continue4686 }4687 }
1312 unmodified lines
modified:test/test_go.rb+7 added
3006 unmodified lines
3007 tmux.send_keys(%(seq 10000 | #{FZF} --info-command 'echo -e "--\\x1b[33m$FZF_POS\\x1b[m/$FZF_INFO--"' --info inline-right), :Enter)3008 tmux.until { assert_match(%r{ --1/10000/10000-- *$}, _1[-1]) }3009 end30103011 def test_info_command_and_focus3012 tmux.send_keys(%(seq 100 | #{FZF} --separator x --info-command 'echo $FZF_POS' --bind focus:clear-query), :Enter)3013 tmux.until { |lines| tmux.until { assert_match(%r{^ 1 xx}, _1[-2]) } }3014 tmux.send_keys :Up3015 tmux.until { |lines| tmux.until { assert_match(%r{^ 2 xx}, _1[-2]) } }3016 end30173018 def test_prev_next_selected3019 tmux.send_keys 'seq 10 | fzf --multi --bind ctrl-n:next-selected,ctrl-p:prev-selected', :Enter3020 tmux.until { |lines| assert_equal 10, lines.item_count }3021 tmux.send_keys :BTab, :BTab, :Up, :BTab
1483 unmodified lines