From d9d2f61ba6ecb9ac26bfbc0d1e52e899a60971c5 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Wed, 7 Oct 2015 18:59:41 -0700 Subject: When autoloading a completion, also autoload the function Fixes a case where a --wraps declaration would be missed because the function would not be loaded. Fixes #2466. --- src/complete.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/complete.cpp') diff --git a/src/complete.cpp b/src/complete.cpp index 3d79de04..74cc19e2 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -75,6 +75,8 @@ static const wcstring &C_(const wcstring &s) } #endif +static void complete_load(const wcstring &name, bool reload); + /* Testing apparatus */ const wcstring_list_t *s_override_variable_names = NULL; @@ -1316,8 +1318,13 @@ static int short_ok(const wcstring &arg_str, wchar_t nextopt, const wcstring &al return 1; } -void complete_load(const wcstring &name, bool reload) + +/* Load command-specific completions for the specified command. */ +static void complete_load(const wcstring &name, bool reload) { + // we have to load this as a function, since it may define a --wraps or signature + // see #2466 + function_load(name); completion_autoloader.load(name, reload); } -- cgit v1.2.3