Skip to content
Myr

Render preview window when the initial query fails to match

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Only if preview template contains {q} Fix #1452 Related #1307

authored by Junegunn Choi · committed by Junegunn Choi · parent d4ed955 · Browse files · 2 files+7 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+7 added−1 removed

  • tests:+6 added−0 removed
  • other:+1 added−1 removed

2 files+7 added−1 removed

modified:src/terminal.go+1 added-1 removed
1531 unmodified lines
1532 }15331534 go func() {1535 var focused *Item1536 var version int641536 var version int64 = -11537 for {1538 t.reqBox.Wait(func(events *util.Events) {1539 defer events.Clear()1540 t.mutex.Lock()
496 unmodified lines
modified:test/test_go.rb+6 added
1425 unmodified lines
1426 tmux.send_keys 'C-u'1427 tmux.until { |lines| !lines[1].include?('foo') }1428 end14291430 def test_preview_q_no_match_with_initial_query1431 tmux.send_keys %(: | #{FZF} --preview 'echo foo {q}{q}' --query foo), :Enter1432 tmux.until { |lines| lines.match_count == 0 }1433 tmux.until { |lines| lines[1].include?('foofoo') }1434 end14351436 def test_no_clear1437 tmux.send_keys "seq 10 | fzf --no-clear --inline-info --height 5 > #{tempname}", :Enter1438 prompt = '> < 10/10'1439 tmux.until { |lines| lines[-1] == prompt }
456 unmodified lines