Mercurial > vim
diff src/eval.c @ 9626:172131507c85 v7.4.2090
commit https://github.com/vim/vim/commit/df48fb456fb6bf63d94cad9b302ff01d8ee8d311
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jul 22 21:50:18 2016 +0200
patch 7.4.2090
Problem: Using submatch() in a lambda passed to substitute() is verbose.
Solution: Use a static list and pass it as an optional argument to the
function. Fix memory leak.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 22 Jul 2016 22:00:07 +0200 |
parents | bf204ab1ce7d |
children | ccbb8e393d80 |
line wrap: on
line diff
--- a/src/eval.c +++ b/src/eval.c @@ -988,7 +988,7 @@ call_vim_function( } rettv->v_type = VAR_UNKNOWN; /* clear_tv() uses this */ - ret = call_func(func, (int)STRLEN(func), rettv, argc, argvars, + ret = call_func(func, (int)STRLEN(func), rettv, argc, argvars, NULL, curwin->w_cursor.lnum, curwin->w_cursor.lnum, &doesrange, TRUE, NULL, NULL); if (safe) @@ -9930,8 +9930,8 @@ filter_map_one(typval_T *tv, typval_T *e if (expr->v_type == VAR_FUNC) { s = expr->vval.v_string; - if (call_func(s, (int)STRLEN(s), - &rettv, 2, argv, 0L, 0L, &dummy, TRUE, NULL, NULL) == FAIL) + if (call_func(s, (int)STRLEN(s), &rettv, 2, argv, NULL, + 0L, 0L, &dummy, TRUE, NULL, NULL) == FAIL) goto theend; } else if (expr->v_type == VAR_PARTIAL) @@ -9939,9 +9939,8 @@ filter_map_one(typval_T *tv, typval_T *e partial_T *partial = expr->vval.v_partial; s = partial->pt_name; - if (call_func(s, (int)STRLEN(s), - &rettv, 2, argv, 0L, 0L, &dummy, TRUE, partial, NULL) - == FAIL) + if (call_func(s, (int)STRLEN(s), &rettv, 2, argv, NULL, + 0L, 0L, &dummy, TRUE, partial, NULL) == FAIL) goto theend; } else