mirror of
https://github.com/junegunn/fzf.git
synced 2025-07-31 20:22:01 -07:00
@@ -5,6 +5,7 @@ CHANGELOG
|
|||||||
------
|
------
|
||||||
- Preview window is `hidden` by default when there are `preview` bindings but
|
- Preview window is `hidden` by default when there are `preview` bindings but
|
||||||
`--preview` command is not given
|
`--preview` command is not given
|
||||||
|
- Fixed bug where `{n}` is not properly reset on `reload`
|
||||||
- Vim plugin
|
- Vim plugin
|
||||||
- `sinklist` is added as a synonym to `sink*` so that it's easier to add
|
- `sinklist` is added as a synonym to `sink*` so that it's easier to add
|
||||||
a function to a spec dictionary
|
a function to a spec dictionary
|
||||||
|
@@ -233,6 +233,7 @@ func Run(opts *Options, version string, revision string) {
|
|||||||
clearCache = util.Once(true)
|
clearCache = util.Once(true)
|
||||||
clearSelection = util.Once(true)
|
clearSelection = util.Once(true)
|
||||||
chunkList.Clear()
|
chunkList.Clear()
|
||||||
|
itemIndex = 0
|
||||||
header = make([]string, 0, opts.HeaderLines)
|
header = make([]string, 0, opts.HeaderLines)
|
||||||
go reader.restart(command)
|
go reader.restart(command)
|
||||||
}
|
}
|
||||||
|
@@ -2053,6 +2053,22 @@ class TestGoFZF < TestBase
|
|||||||
tmux.send_keys 'dabcd'
|
tmux.send_keys 'dabcd'
|
||||||
tmux.until { |lines| assert_equal '> abcd', lines[-1] }
|
tmux.until { |lines| assert_equal '> abcd', lines[-1] }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_item_index_reset_on_reload
|
||||||
|
tmux.send_keys "seq 10 | #{FZF} --preview 'echo [[{n}]]' --bind 'up:last,down:first,space:reload:seq 100'", :Enter
|
||||||
|
tmux.until { |lines| assert_includes lines[1], '[[0]]' }
|
||||||
|
tmux.send_keys :Up
|
||||||
|
tmux.until { |lines| assert_includes lines[1], '[[9]]' }
|
||||||
|
tmux.send_keys :Down
|
||||||
|
tmux.until { |lines| assert_includes lines[1], '[[0]]' }
|
||||||
|
tmux.send_keys :Space
|
||||||
|
tmux.until do |lines|
|
||||||
|
assert_equal 100, lines.item_count
|
||||||
|
assert_includes lines[1], '[[0]]'
|
||||||
|
end
|
||||||
|
tmux.send_keys :Up
|
||||||
|
tmux.until { |lines| assert_includes lines[1], '[[99]]' }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
module TestShell
|
module TestShell
|
||||||
|
Reference in New Issue
Block a user