From 644171fac660c51c539d3ab6195e236fc7bc003c Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 27 Nov 2024 08:38:10 +0100 Subject: [PATCH] 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 --- src/function.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/function.rs b/src/function.rs index 55dabc547..59e21b7d4 100644 --- a/src/function.rs +++ b/src/function.rs @@ -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.