mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 03:32:27 +08:00
Fix #213. You can now remove autoloaded functions.
Oddly enough, the code is here, but is internal function.
This commit is contained in:
parent
97e731e05c
commit
1349d129c5
|
@ -1339,7 +1339,7 @@ static int builtin_functions(parser_t &parser, wchar_t **argv)
|
|||
{
|
||||
int i;
|
||||
for (i=woptind; i<argc; i++)
|
||||
function_remove(argv[i]);
|
||||
function_remove_ignore_autoload(argv[i]);
|
||||
return STATUS_BUILTIN_OK;
|
||||
}
|
||||
else if (desc)
|
||||
|
|
|
@ -61,9 +61,6 @@ function_autoload_t::function_autoload_t() : autoload_t(L"fish_function_path", N
|
|||
{
|
||||
}
|
||||
|
||||
/** Removes a function from our internal table, returning true if it was found and false if not */
|
||||
static bool function_remove_ignore_autoload(const wcstring &name);
|
||||
|
||||
/** Callback when an autoloaded function is removed */
|
||||
void function_autoload_t::command_removed(const wcstring &cmd)
|
||||
{
|
||||
|
@ -220,7 +217,7 @@ int function_exists_no_autoload(const wcstring &cmd, const env_vars_snapshot_t &
|
|||
return loaded_functions.find(cmd) != loaded_functions.end() || function_autoloader.can_load(cmd, vars);
|
||||
}
|
||||
|
||||
static bool function_remove_ignore_autoload(const wcstring &name)
|
||||
bool function_remove_ignore_autoload(const wcstring &name)
|
||||
{
|
||||
scoped_lock lock(functions_lock);
|
||||
bool erased = (loaded_functions.erase(name) > 0);
|
||||
|
|
|
@ -95,6 +95,9 @@ void function_init();
|
|||
/** Add a function. */
|
||||
void function_add(const function_data_t &data, const parser_t &parser);
|
||||
|
||||
/** Removes a function from our internal table, returning true if it was found and false if not */
|
||||
bool function_remove_ignore_autoload(const wcstring &name);
|
||||
|
||||
/**
|
||||
Remove the function with the specified name.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user