aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/regexp.c
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-05-21 15:12:35 +0100
committerSean Dewar <seandewar@users.noreply.github.com>2021-08-12 22:31:18 +0100
commit4042ae5a2bc4bbca608ebb196a3d54a78d6c100c (patch)
tree6da940b00ff0f62ef3a2ebdeb730726e0f69755b /src/nvim/regexp.c
parent60dd76c7e29e75dee641f93483eb6e5c2afb28e4 (diff)
downloadrneovim-4042ae5a2bc4bbca608ebb196a3d54a78d6c100c.tar.gz
rneovim-4042ae5a2bc4bbca608ebb196a3d54a78d6c100c.tar.bz2
rneovim-4042ae5a2bc4bbca608ebb196a3d54a78d6c100c.zip
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. https://github.com/vim/vim/commit/c6538bcc1cdd1fb83732f22fdc69bd9bb66f968a Use FUNCEXE_INIT to initialize funcexe_T instances. call_callback() and other Vim listener related stuff is N/A.
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r--src/nvim/regexp.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index 6379174938..98a46cf781 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -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.