diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 5 | ||||
-rw-r--r-- | src/nvim/testdir/test_expr.vim | 7 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 0872ed37ad..8f52717252 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -13804,8 +13804,9 @@ static void max_min(typval_T *argvars, typval_T *rettv, int domax) } } } - } else - EMSG(_(e_listdictarg)); + } else { + EMSG2(_(e_listdictarg), domax ? "max()" : "min()"); + } rettv->vval.v_number = error ? 0 : n; } diff --git a/src/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim index 2541d38d12..03a9155512 100644 --- a/src/nvim/testdir/test_expr.vim +++ b/src/nvim/testdir/test_expr.vim @@ -335,6 +335,13 @@ function Test_printf_errors() call assert_fails('echo printf("%d", 1.2)', 'E805:') endfunc +function Test_max_min_errors() + call assert_fails('call max(v:true)', 'E712:') + call assert_fails('call max(v:true)', 'max()') + call assert_fails('call min(v:true)', 'E712:') + call assert_fails('call min(v:true)', 'min()') +endfunc + func Test_substitute_expr() let g:val = 'XXX' call assert_equal('XXX', substitute('yyy', 'y*', '\=g:val', '')) diff --git a/src/nvim/version.c b/src/nvim/version.c index cbb7902985..32ef2c2fdb 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -112,7 +112,7 @@ static int included_patches[] = { // 2332 NA 2331, // 2330, - // 2329, + 2329, // 2328, // 2327 NA 2326, |