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,8 +267,9 @@ impl MappableCommand {
} else {
// TODO: Update this
let args = args.split_whitespace().map(Cow::from).collect();
ScriptingEngine::call_function_by_name(cx, name, args);
cx.editor.set_error(format!("no such command: '{name}'"));
if !ScriptingEngine::call_function_by_name(cx, name, args) {
cx.editor.set_error(format!("no such command: '{name}'"));
}
}
}
Self::Static { fun, .. } => (fun)(cx),