complete: Do fuzzy match for --do-complete

This only did prefix matching, which is generally less useful.

All existing users _should_ be okay with this since they want to
provide completions.

Fixes #5467.
Fixes #2318.
This commit is contained in:
Fabian Homborg 2019-03-12 20:25:04 +01:00
parent bfb61879cd
commit ecfe4acd0c
2 changed files with 2 additions and 1 deletions

View file

@ -22,6 +22,7 @@
- `math` now accepts `--scale=max` for the maximum scale (#5579).
- The `forward-bigword` binding now interacts correctly with autosuggestions (#5336)
- Fish now tries to guess if the system supports Unicode 9 (and displays emoji as wide), hopefully making setting $fish_emoji_width superfluous in most cases (#5722).
- `complete --do-complete` now also does fuzzy matches (#5467).
- Lots of improvements to completions.
- Added completions for
- `cf`

View file

@ -318,7 +318,7 @@ int builtin_complete(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
recursion_level++;
std::vector<completion_t> comp;
complete(do_complete_param, &comp, COMPLETION_REQUEST_DEFAULT, parser.vars());
complete(do_complete_param, &comp, COMPLETION_REQUEST_DEFAULT | COMPLETION_REQUEST_FUZZY_MATCH, parser.vars());
for (size_t i = 0; i < comp.size(); i++) {
const completion_t &next = comp.at(i);