mirror of
https://github.com/junegunn/fzf.git
synced 2025-05-19 04:40:22 -07:00
Do not ignore current query when input is hidden
* The initial query given by --query should be respected * The current query should still be respected after `hide-input` (or `toggle-input) Fix #4327
This commit is contained in:
parent
62238620a5
commit
f43e82f17f
@ -1418,10 +1418,7 @@ func (t *Terminal) Input() (bool, []rune) {
|
|||||||
t.mutex.Lock()
|
t.mutex.Lock()
|
||||||
defer t.mutex.Unlock()
|
defer t.mutex.Unlock()
|
||||||
paused := t.paused
|
paused := t.paused
|
||||||
var src []rune
|
src := t.input
|
||||||
if !t.inputless {
|
|
||||||
src = t.input
|
|
||||||
}
|
|
||||||
if t.inputOverride != nil {
|
if t.inputOverride != nil {
|
||||||
paused = false
|
paused = false
|
||||||
src = *t.inputOverride
|
src = *t.inputOverride
|
||||||
|
@ -1856,4 +1856,14 @@ class TestCore < TestInteractive
|
|||||||
tmux.send_keys :Space
|
tmux.send_keys :Space
|
||||||
tmux.until { |lines| assert_includes lines[line + 2], "> 5" }
|
tmux.until { |lines| assert_includes lines[line + 2], "> 5" }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_no_input_query
|
||||||
|
tmux.send_keys %(seq 1000 | #{FZF} --no-input --query 555 --bind space:toggle-input), :Enter
|
||||||
|
tmux.until { |lines| assert_includes lines, '> 555' }
|
||||||
|
tmux.send_keys :Space
|
||||||
|
tmux.until do |lines|
|
||||||
|
assert_equal 1, lines.match_count
|
||||||
|
assert_includes lines, '> 555'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user