mirror of
https://github.com/neovim/neovim.git
synced 2025-09-08 04:18:18 +00:00
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:
@@ -6726,26 +6726,24 @@ static int vim_regsub_both(char_u *source, typval_T *expr, char_u *dest,
|
||||
|
||||
if (expr != NULL) {
|
||||
typval_T argv[2];
|
||||
int dummy;
|
||||
typval_T rettv;
|
||||
staticList10_T matchList = TV_LIST_STATIC10_INIT;
|
||||
|
||||
rettv.v_type = VAR_STRING;
|
||||
rettv.vval.v_string = NULL;
|
||||
argv[0].v_type = VAR_LIST;
|
||||
argv[0].vval.v_list = &matchList.sl_list;
|
||||
funcexe_T funcexe = FUNCEXE_INIT;
|
||||
funcexe.argv_func = fill_submatch_list;
|
||||
funcexe.evaluate = true;
|
||||
if (expr->v_type == VAR_FUNC) {
|
||||
s = expr->vval.v_string;
|
||||
call_func(s, -1, &rettv, 1, argv,
|
||||
fill_submatch_list, 0L, 0L, &dummy,
|
||||
true, NULL, NULL);
|
||||
call_func(s, -1, &rettv, 1, argv, &funcexe);
|
||||
} else if (expr->v_type == VAR_PARTIAL) {
|
||||
partial_T *partial = expr->vval.v_partial;
|
||||
|
||||
s = partial_name(partial);
|
||||
call_func(s, -1, &rettv, 1, argv,
|
||||
fill_submatch_list, 0L, 0L, &dummy,
|
||||
true, partial, NULL);
|
||||
funcexe.partial = partial;
|
||||
call_func(s, -1, &rettv, 1, argv, &funcexe);
|
||||
}
|
||||
if (tv_list_len(&matchList.sl_list) > 0) {
|
||||
// fill_submatch_list() was called.
|
||||
|
Reference in New Issue
Block a user