From ecfe4acd0c224c02d57f962fd62b8adb8c9e2a35 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Tue, 12 Mar 2019 20:25:04 +0100 Subject: [PATCH] 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. --- CHANGELOG.md | 1 + src/builtin_complete.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0099e2300..2e4244899 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` diff --git a/src/builtin_complete.cpp b/src/builtin_complete.cpp index 2a01fcd26..1af41f394 100644 --- a/src/builtin_complete.cpp +++ b/src/builtin_complete.cpp @@ -318,7 +318,7 @@ int builtin_complete(parser_t &parser, io_streams_t &streams, wchar_t **argv) { recursion_level++; std::vector 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);