mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-02-02 03:58:30 +00:00
parent
06547d0cbe
commit
afc2f05e5e
@ -4678,6 +4678,9 @@ func (t *Terminal) Loop() error {
|
|||||||
if onFocus, prs := t.keymap[tui.Focus.AsEvent()]; prs && iter < maxFocusEvents {
|
if onFocus, prs := t.keymap[tui.Focus.AsEvent()]; prs && iter < maxFocusEvents {
|
||||||
if newIndex := t.currentIndex(); newIndex != currentIndex {
|
if newIndex := t.currentIndex(); newIndex != currentIndex {
|
||||||
t.lastFocus = newIndex
|
t.lastFocus = newIndex
|
||||||
|
if t.infoCommand != "" {
|
||||||
|
req(reqInfo)
|
||||||
|
}
|
||||||
actions = onFocus
|
actions = onFocus
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -3008,6 +3008,13 @@ class TestGoFZF < TestBase
|
|||||||
tmux.until { assert_match(%r{ --1/10000/10000-- *$}, _1[-1]) }
|
tmux.until { assert_match(%r{ --1/10000/10000-- *$}, _1[-1]) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_info_command_and_focus
|
||||||
|
tmux.send_keys(%(seq 100 | #{FZF} --separator x --info-command 'echo $FZF_POS' --bind focus:clear-query), :Enter)
|
||||||
|
tmux.until { |lines| tmux.until { assert_match(%r{^ 1 xx}, _1[-2]) } }
|
||||||
|
tmux.send_keys :Up
|
||||||
|
tmux.until { |lines| tmux.until { assert_match(%r{^ 2 xx}, _1[-2]) } }
|
||||||
|
end
|
||||||
|
|
||||||
def test_prev_next_selected
|
def test_prev_next_selected
|
||||||
tmux.send_keys 'seq 10 | fzf --multi --bind ctrl-n:next-selected,ctrl-p:prev-selected', :Enter
|
tmux.send_keys 'seq 10 | fzf --multi --bind ctrl-n:next-selected,ctrl-p:prev-selected', :Enter
|
||||||
tmux.until { |lines| assert_equal 10, lines.item_count }
|
tmux.until { |lines| assert_equal 10, lines.item_count }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user