mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-01 04:32:05 -07:00
Add 'focus' event
Can we find a better name? I have considered the followings. * 'point', because "the pointer" points to the current item. * 'shift', 'switch', 'move', etc. These are not technically correct because the current item can change without cursor movement (--tac, reload, search update) * 'change' is already taken. 'change-current' feels a bit wordy and sounds wrong, 'current-changed' is wordy and doesn't go well with the other event names * 'target', not straightforward Close #3053
This commit is contained in:
@@ -2473,6 +2473,15 @@ class TestGoFZF < TestBase
|
||||
end
|
||||
end
|
||||
|
||||
def test_focus_event
|
||||
tmux.send_keys 'seq 100 | fzf --bind "focus:transform-prompt(echo [[{}]])"', :Enter
|
||||
tmux.until { |lines| assert_includes(lines[-1], '[[1]]') }
|
||||
tmux.send_keys :Up
|
||||
tmux.until { |lines| assert_includes(lines[-1], '[[2]]') }
|
||||
tmux.send_keys :X
|
||||
tmux.until { |lines| assert_includes(lines[-1], '[[]]') }
|
||||
end
|
||||
|
||||
def test_labels_center
|
||||
tmux.send_keys 'echo x | fzf --border --border-label foobar --preview : --preview-label barfoo --bind "space:change-border-label(foobarfoo)+change-preview-label(barfoobar),enter:transform-border-label(echo foo{}foo)+transform-preview-label(echo bar{}bar)"', :Enter
|
||||
tmux.until do
|
||||
|
Reference in New Issue
Block a user