diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 48ba1a06f..06bda783b 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -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),