From dd317709f8032bfc6074170b51614ad511dc19f8 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Wed, 26 Dec 2012 15:28:25 -0800 Subject: [PATCH] Fix to avoid suggesting files for empty tokens --- complete.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/complete.cpp b/complete.cpp index acafa2ec4..55c7598a9 100644 --- a/complete.cpp +++ b/complete.cpp @@ -1970,7 +1970,11 @@ void complete(const wcstring &cmd, std::vector &comps, complete_ty See https://github.com/fish-shell/fish-shell/issues/378 */ if (commands_to_load != NULL && completer.has_commands_to_load()) do_file = false; - + + /* And if we're autosuggesting, and the token is empty, don't do file suggestions */ + if (type == COMPLETE_AUTOSUGGEST && current_token_unescape.empty()) + do_file = false; + /* This function wants the unescaped string */