m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-17 07:43:39 -05:00

Add {*} placeholder flag

This commit is contained in:
Junegunn Choi
2025-06-19 01:03:42 +09:00
parent 4d2d6a5ced
commit 27258f7207
4 changed files with 73 additions and 44 deletions

View File

@@ -189,6 +189,16 @@ class TestPreview < TestInteractive
tmux.until { |lines| assert_includes lines[1], ' {//1 10/1 10 /123//0 9} ' }
end
def test_preview_asterisk
tmux.send_keys %(seq 5 | #{FZF} --multi --preview 'echo {} / {+} / {*}'), :Enter
tmux.until { |lines| assert_equal 5, lines.match_count }
tmux.until { |lines| assert_includes lines[1], ' 1 / 1 / 1 2 3 4 5 ' }
tmux.send_keys :BTab
tmux.until { |lines| assert_includes lines[1], ' 2 / 1 / 1 2 3 4 5 ' }
tmux.send_keys :BTab
tmux.until { |lines| assert_includes lines[1], ' 3 / 1 2 / 1 2 3 4 5 ' }
end
def test_preview_file
tmux.send_keys %[(echo foo bar; echo bar foo) | #{FZF} --multi --preview 'cat {+f} {+f2} {+nf} {+fn}' --print0], :Enter
tmux.until { |lines| assert_includes lines[1], ' foo barbar00 ' }