aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/complete.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-10-07 18:59:41 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-10-07 18:59:41 -0700
commitd9d2f61ba6ecb9ac26bfbc0d1e52e899a60971c5 (patch)
tree58e0664ad3c1fd73af0305632f49e20d69bd717b /src/complete.cpp
parent434eabb7878178a095b8508ccbf5d232461e8d95 (diff)
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.
Diffstat (limited to 'src/complete.cpp')
-rw-r--r--src/complete.cpp9
1 files changed, 8 insertions, 1 deletions
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);
}