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.
This commit is contained in:
ridiculousfish
2015-10-07 18:59:41 -07:00
parent 434eabb787
commit d9d2f61ba6
4 changed files with 20 additions and 14 deletions

View File

@@ -222,6 +222,15 @@ int function_exists(const wcstring &cmd)
return loaded_functions.find(cmd) != loaded_functions.end();
}
void function_load(const wcstring &cmd)
{
if (! parser_keywords_is_reserved(cmd))
{
scoped_lock lock(functions_lock);
load(cmd);
}
}
int function_exists_no_autoload(const wcstring &cmd, const env_vars_snapshot_t &vars)
{
if (parser_keywords_is_reserved(cmd))