remove erroneous no such command when the command succeeds

pull/8675/merge^2
Matt Paras 2025-04-08 17:44:50 -07:00
parent c9b52761ec
commit 43b9dd3e65
1 changed files with 3 additions and 2 deletions

View File

@ -267,10 +267,11 @@ impl MappableCommand {
} else { } else {
// TODO: Update this // TODO: Update this
let args = args.split_whitespace().map(Cow::from).collect(); let args = args.split_whitespace().map(Cow::from).collect();
ScriptingEngine::call_function_by_name(cx, name, args); if !ScriptingEngine::call_function_by_name(cx, name, args) {
cx.editor.set_error(format!("no such command: '{name}'")); cx.editor.set_error(format!("no such command: '{name}'"));
} }
} }
}
Self::Static { fun, .. } => (fun)(cx), Self::Static { fun, .. } => (fun)(cx),
Self::Macro { keys, .. } => { Self::Macro { keys, .. } => {
// Protect against recursive macros. // Protect against recursive macros.