diff options
author | Marco Hinz <mh.codebro+github@gmail.com> | 2018-12-11 23:43:35 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-12-11 23:43:35 +0100 |
commit | 5fee0be915525fe00519a17cccda2947dfdfbc6a (patch) | |
tree | 9138d64d932cc7370db58720a4a281635fe271df /src/nvim/ex_cmds2.c | |
parent | 3c42d7a10a044b94f4050a2c0ea68d142d5c62eb (diff) | |
download | rneovim-5fee0be915525fe00519a17cccda2947dfdfbc6a.tar.gz rneovim-5fee0be915525fe00519a17cccda2947dfdfbc6a.tar.bz2 rneovim-5fee0be915525fe00519a17cccda2947dfdfbc6a.zip |
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
Diffstat (limited to 'src/nvim/ex_cmds2.c')
-rw-r--r-- | src/nvim/ex_cmds2.c | 7 |
1 files changed, 6 insertions, 1 deletions
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); + } } } |