Change custom fuzzy completion API

To make it easier to write more complex fzf options. Although this
does not break backward compatibility, users are encouraged to update
their code accordingly.

  # Before
  _fzf_complete "FZF_ARG1 FZF_ARG2..." "$@" < <(
    # Print candidates
  )

  # After
  _fzf_complete FZF_ARG1 FZF_ARG2... -- "$@" < <(
    # Print candidates
  )
This commit is contained in:
Junegunn Choi
2020-03-11 18:29:39 +09:00
parent 7085e5b629
commit 50b7608f9d
5 changed files with 177 additions and 17 deletions

View File

@@ -14,6 +14,20 @@ CHANGELOG
- Bug fixes and improvements
- Vim plugin: Floating windows support
- bash: Various improvements in key bindings (CTRL-T, CTRL-R, ALT-C)
- Fuzzy completion API changed
```sh
# Previous: fzf arguments given as a single string argument
# - This style is still supported, but it is deprecated
_fzf_complete "--multi --reverse --prompt=\"doge> \"" "$@" < <(
echo foo
)
# New API: multiple fzf arguments before "--"
# - More rebust and easier to write options
_fzf_complete --multi --reverse --prompt="doge> " -- "$@" < <(
echo foo
)
```
0.20.0
------