Allow {q} placeholders with range expressions

e.g. {q:1}, {q:2..}
This commit is contained in:
Junegunn Choi
2025-01-27 15:40:21 +09:00
parent 2f8a72a42a
commit a2aa1a156c
6 changed files with 49 additions and 34 deletions

View File

@@ -209,9 +209,9 @@ class TestPreview < TestInteractive
end
def test_preview_q_no_match_with_initial_query
tmux.send_keys %(: | #{FZF} --preview 'echo foo {q}{q}' --query foo), :Enter
tmux.send_keys %(: | #{FZF} --preview 'echo foo {q}/{q}/{q:1}/{q:..}/{q:2}/{q:-1}/{q:-2}/{q:x}' --query 'foo bar'), :Enter
tmux.until { |lines| assert_equal 0, lines.match_count }
tmux.until { |lines| assert_includes lines[1], ' foofoo ' }
tmux.until { |lines| assert_includes lines[1], ' foo bar/foo bar/foo/foo bar/bar/bar/foo/{q:x} ' }
end
def test_preview_update_on_select