summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2022-03-29 22:25:48 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2022-03-29 22:27:03 +0900
commit5209e95bc7132004637aef61b1dfd9e1e489f8a2 (patch)
treef383627a77040565d92a6eea6c79a94e6928b314
parentef67a45702c01ff93e0ea99a51594c8160f66cc1 (diff)
downloadfzf-5209e95bc7132004637aef61b1dfd9e1e489f8a2.tar.gz
Make preview updated when reload and change-query are combined
Fix #2744
-rw-r--r--CHANGELOG.md2
-rw-r--r--src/terminal.go1
-rwxr-xr-xtest/test_go.rb9
3 files changed, 11 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 616d4384..061bf857 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,7 +12,7 @@ CHANGELOG
fzf --nth=-1 --no-hscroll --ellipsis='' |
awk '{print $2}'
```
-- Increased TTY buffer limit (#2748)
+- Bug fixes and improvements
0.29.0
------
diff --git a/src/terminal.go b/src/terminal.go
index 9ea0c1a9..44dea494 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -673,6 +673,7 @@ func (t *Terminal) UpdateList(merger *Merger, reset bool) {
t.merger = merger
if reset {
t.selected = make(map[int32]selectedItem)
+ t.version++
}
t.mutex.Unlock()
t.reqBox.Set(reqInfo, nil)
diff --git a/test/test_go.rb b/test/test_go.rb
index bd950604..74f9851a 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -2077,6 +2077,15 @@ class TestGoFZF < TestBase
tmux.until { |lines| assert_includes lines[1], '4' }
end
+ def test_reload_and_change_preview_should_update_preview
+ tmux.send_keys "seq 3 | #{FZF} --bind 'ctrl-t:reload(echo 4)+change-preview(echo {})'", :Enter
+ tmux.until { |lines| assert_equal 3, lines.item_count }
+ tmux.until { |lines| refute_includes lines[1], '1' }
+ tmux.send_keys 'C-t'
+ tmux.until { |lines| assert_equal 1, lines.item_count }
+ tmux.until { |lines| assert_includes lines[1], '4' }
+ end
+
def test_scroll_off
tmux.send_keys "seq 1000 | #{FZF} --scroll-off=3 --bind l:last", :Enter
tmux.until { |lines| assert_equal 1000, lines.item_count }