Reload should update preview window

Fix #2644
This commit is contained in:
Junegunn Choi 2021-10-23 01:06:15 +09:00
parent 4138333f5c
commit 97ae8afb6f
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
2 changed files with 8 additions and 0 deletions

View File

@ -2673,6 +2673,7 @@ func (t *Terminal) Loop() {
command := t.replacePlaceholder(a.a, false, string(t.input), list)
newCommand = &command
t.reading = true
t.version++
}
case actUnbind:
keys := parseKeyChords(a.a, "PANIC")

View File

@ -2069,6 +2069,13 @@ class TestGoFZF < TestBase
tmux.send_keys :Up
tmux.until { |lines| assert_includes lines[1], '[[99]]' }
end
def test_reload_should_update_preview
tmux.send_keys "seq 3 | #{FZF} --bind 'ctrl-t:reload:echo 4' --preview 'echo {}' --preview-window 'nohidden'", :Enter
tmux.until { |lines| assert_includes lines[1], '1' }
tmux.send_keys 'C-t'
tmux.until { |lines| assert_includes lines[1], '4' }
end
end
module TestShell