From 5fee0be915525fe00519a17cccda2947dfdfbc6a Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Tue, 11 Dec 2018 23:43:35 +0100 Subject: provider: improve error message (#9344) Executing `:python`, and similar commands that rely on `eval_call_provider()`, while the accompanying provider it not available, leads to this error message: E117: Unknown function: provider#python#Call This doesn't say much to a user. Since we introduced `:checkhealth` for this very reason, we now point to it for further diagnosis. Fixes #3577 --- src/nvim/ex_cmds2.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 76c71a00ec..d03bfd2488 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -3828,7 +3828,12 @@ static void script_host_execute(char *name, exarg_T *eap) // current range tv_list_append_number(args, (int)eap->line1); tv_list_append_number(args, (int)eap->line2); - (void)eval_call_provider(name, "execute", args); + + if (!eval_has_provider(name)) { + emsgf("No \"%s\" provider found. Run \":checkhealth provider\"", name); + } else { + (void)eval_call_provider(name, "execute", args); + } } } -- cgit