From cc50103e5343953df20ac93eb6ab6591a6c6d30e Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Tue, 3 Apr 2018 14:05:07 -0500 Subject: [PATCH] Unblock builtins from completions The `head_exists` value was being reset after being set to true for most builtins, causing completions to not trigger. --- src/complete.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/complete.cpp b/src/complete.cpp index dbff9065c..acf9ea477 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -870,12 +870,12 @@ bool completer_t::complete_param(const wcstring &scmd_orig, const wcstring &spop run_on_main_thread([&completion_snapshot] () { completion_snapshot = std::move(env_vars_snapshot_t( (wchar_t const * const []) { L"fish_function_path", nullptr } )); }); - } - head_exists = function_exists_no_autoload(cmd.c_str(), completion_snapshot); - // While it may seem like first testing `path_get_path` before resorting to an env lookup may be faster, path_get_path can potentially - // do a lot of FS/IO access, so env.get() + function_exists() should still be faster. - head_exists = head_exists || path_get_path(cmd, nullptr); + head_exists = function_exists_no_autoload(cmd.c_str(), completion_snapshot); + // While it may seem like first testing `path_get_path` before resorting to an env lookup may be faster, path_get_path can potentially + // do a lot of FS/IO access, so env.get() + function_exists() should still be faster. + head_exists = head_exists || path_get_path(cmd, nullptr); + } if (!head_exists) { //Do not load custom completions if the head does not exist