Make --expect additive

Similarly to --bind or --color.

--expect used to replace the previously specified keys, and
fzf#wrap({'options': '--expect=f1'}) wouldn't work as expected. It
forced us to come up with some ugly hacks like the following:

13b27c45c8/autoload/fzf/vim.vim (L1086)
This commit is contained in:
Junegunn Choi
2017-08-27 02:19:39 +09:00
parent 6b4805ca1a
commit fee404399a
3 changed files with 17 additions and 4 deletions

View File

@@ -414,3 +414,10 @@ func TestPreviewOpts(t *testing.T) {
t.Error(opts.Preview)
}
}
func TestAdditiveExpect(t *testing.T) {
opts := optsFor("--expect=a", "--expect", "b", "--expect=c")
if len(opts.Expect) != 3 {
t.Error(opts.Expect)
}
}