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 
This commit is contained in:
Johannes Altmanninger 2024-11-27 08:38:10 +01:00
parent c625a324ba
commit 644171fac6

View File

@ -241,7 +241,8 @@ pub fn exists_no_autoload(cmd: &wstr) -> bool {
}
let mut funcset = FUNCTION_SET.lock().unwrap();
// 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.