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

Add 'f' flag for placeholder expression (#1733)

If present the contents of the selection will be placed in a temporary file,
and the filename will be placed into the string instead.
This commit is contained in:
Simon Fraser
2019-10-27 14:50:12 +00:00
committed by Junegunn Choi
parent 0c6c76e081
commit 391669a451
4 changed files with 84 additions and 29 deletions

View File

@@ -1417,6 +1417,15 @@ class TestGoFZF < TestBase
tmux.until { |lines| lines[1].include?('{//1 10/1 10 /123//0 9}') }
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| lines[1].include?('foo barbar00') }
tmux.send_keys :BTab
tmux.until { |lines| lines[1].include?('foo barbar00') }
tmux.send_keys :BTab
tmux.until { |lines| lines[1].include?('foo barbar foobarfoo0101') }
end
def test_preview_q_no_match
tmux.send_keys %(: | #{FZF} --preview 'echo foo {q}'), :Enter
tmux.until { |lines| lines.match_count == 0 }