changeset 10116:a6068b90c873 v7.4.2329

commit https://github.com/vim/vim/commit/26b84339fd8766898bcf6a259cbc2e0c38689726 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 4 21:42:36 2016 +0200 patch 7.4.2329 Problem: Error for min() and max() contains %s. (Nikolay Pavlov) Solution: Pass the function name. (closes https://github.com/vim/vim/issues/1040)
author Christian Brabandt <cb@256bit.org>
date Sun, 04 Sep 2016 21:45:07 +0200
parents d44279295365
children 0e4f59f9bbae
files src/evalfunc.c src/testdir/test_expr.vim src/version.c
diffstat 3 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -7629,7 +7629,7 @@ max_min(typval_T *argvars, typval_T *ret
 	}
     }
     else
-	EMSG(_(e_listdictarg));
+	EMSG2(_(e_listdictarg), domax ? "max()" : "min()");
     rettv->vval.v_number = error ? 0 : n;
 }
 
--- a/src/testdir/test_expr.vim
+++ b/src/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
+
 function Test_printf_64bit()
   if has('num64')
     call assert_equal("123456789012345", printf('%d', 123456789012345))
--- a/src/version.c
+++ b/src/version.c
@@ -764,6 +764,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2329,
+/**/
     2328,
 /**/
     2327,