diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-08-12 17:19:05 +0100 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-08-12 22:35:25 +0100 |
commit | da9005af792f7a7eaae98ee9f6499af9a97fd095 (patch) | |
tree | 33c56d2b3d5f658084b777d24d0426309955c995 /src | |
parent | 5503d8e28b1636f07bff4123a824b9ffdde4ca29 (diff) | |
download | rneovim-da9005af792f7a7eaae98ee9f6499af9a97fd095.tar.gz rneovim-da9005af792f7a7eaae98ee9f6499af9a97fd095.tar.bz2 rneovim-da9005af792f7a7eaae98ee9f6499af9a97fd095.zip |
fix(v:lua): fix emsg when calling v:lua directly
v:lua expressions are represented using vvlua_partial. As v:lua isn't
intended to be called directly, it's given an empty pt_name.
Because of this, calling v:lua directly like "v:lua()" will cause "E117:
Unknown function: ", with an empty name.
Instead, have call_func() show the name "v:lua" in the emsg.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval/userfunc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c index 4f10d31615..5ffd578891 100644 --- a/src/nvim/eval/userfunc.c +++ b/src/nvim/eval/userfunc.c @@ -1516,6 +1516,10 @@ call_func( if (len > 0) { error = ERROR_NONE; nlua_typval_call((const char *)funcname, len, argvars, argcount, rettv); + } else { + // v:lua was called directly; show its name in the emsg + XFREE_CLEAR(name); + funcname = (const char_u *)"v:lua"; } } else if (fp != NULL || !builtin_function((const char *)rfname, -1)) { // User defined function. |