vim-patch:8.1.1800: function call functions have too many arguments

Problem:    Function call functions have too many arguments.
Solution:   Pass values in a funcexe_T struct.
c6538bcc1c

Use FUNCEXE_INIT to initialize funcexe_T instances.

call_callback() and other Vim listener related stuff is N/A.
This commit is contained in:
Sean Dewar
2021-05-21 15:12:35 +01:00
parent 60dd76c7e2
commit 4042ae5a2b
8 changed files with 126 additions and 102 deletions

View File

@@ -780,13 +780,13 @@ int nlua_call(lua_State *lstate)
try_start();
typval_T rettv;
int dummy;
funcexe_T funcexe = FUNCEXE_INIT;
funcexe.firstline = curwin->w_cursor.lnum;
funcexe.lastline = curwin->w_cursor.lnum;
funcexe.evaluate = true;
// call_func() retval is deceptive, ignore it. Instead we set `msg_list`
// (TRY_WRAP) to capture abort-causing non-exception errors.
(void)call_func(name, (int)name_len, &rettv, nargs,
vim_args, NULL,
curwin->w_cursor.lnum, curwin->w_cursor.lnum,
&dummy, true, NULL, NULL);
(void)call_func(name, (int)name_len, &rettv, nargs, vim_args, &funcexe);
if (!try_end(&err)) {
nlua_push_typval(lstate, &rettv, false);
}