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
This commit is contained in:
Marco Hinz 2018-12-11 23:43:35 +01:00 committed by Justin M. Keyes
parent 3c42d7a10a
commit 5fee0be915
1 changed files with 6 additions and 1 deletions

View File

@ -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);
}
}
}