mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-23 00:43:39 +08:00
fix: check whether a function is tombstoned during highlight
exists_no_autoload() wrongly thinks that tombstoned functions can be autoloaded; fix that. While at-it replace the use of get_props() with something simpler. Co-authored-by: Himadri Bhattacharjee Closes #10873
This commit is contained in:
parent
c625a324ba
commit
644171fac6
|
@ -241,7 +241,8 @@ pub fn exists_no_autoload(cmd: &wstr) -> bool {
|
||||||
}
|
}
|
||||||
let mut funcset = FUNCTION_SET.lock().unwrap();
|
let mut funcset = FUNCTION_SET.lock().unwrap();
|
||||||
// Check if we either have the function, or it could be autoloaded.
|
// Check if we either have the function, or it could be autoloaded.
|
||||||
funcset.get_props(cmd).is_some() || funcset.autoloader.can_autoload(cmd)
|
let tombstoned = funcset.autoload_tombstones.contains(cmd);
|
||||||
|
funcset.funcs.contains_key(cmd) || (!tombstoned && funcset.autoloader.can_autoload(cmd))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Remove the function with the specified name.
|
/// Remove the function with the specified name.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user