mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 07:58:35 +00:00
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.
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user