]> granicus.if.org Git - vim/commitdiff
patch 7.4.2329 v7.4.2329
authorBram Moolenaar <Bram@vim.org>
Sun, 4 Sep 2016 19:42:36 +0000 (21:42 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 4 Sep 2016 19:42:36 +0000 (21:42 +0200)
Problem:    Error for min() and max() contains %s. (Nikolay Pavlov)
Solution:   Pass the function name. (closes #1040)

src/evalfunc.c
src/testdir/test_expr.vim
src/version.c

index 9d94694d82eca1c011caec0172cb6e02a458a681..1c1dcf71202428d7dd344e0fb1a54211613abbe6 100644 (file)
@@ -7629,7 +7629,7 @@ max_min(typval_T *argvars, typval_T *rettv, int domax)
        }
     }
     else
-       EMSG(_(e_listdictarg));
+       EMSG2(_(e_listdictarg), domax ? "max()" : "min()");
     rettv->vval.v_number = error ? 0 : n;
 }
 
index 3097daf4437c5325ed431d216f7d29670b0e83fc..108ee508ea0f94d0dde447ef38d685cc2ca0b5a0 100644 (file)
@@ -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))
index 89e5f9509cc1bbc2a06e5090ff3f498b25caae18..42eeaa84e5af7fcd61ba4ac5914a22eff40dd858 100644 (file)
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2329,
 /**/
     2328,
 /**/