]> granicus.if.org Git - vim/commitdiff
patch 8.2.3342: test for :let errors fails v8.2.3342
authorBram Moolenaar <Bram@vim.org>
Sat, 14 Aug 2021 12:27:30 +0000 (14:27 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 14 Aug 2021 12:27:30 +0000 (14:27 +0200)
Problem:    Test for :let errors fails.
Solution:   Adjust the test and how to avoid a second error message.

src/evalvars.c
src/testdir/test_let.vim
src/version.c

index 86a66940414c6548d28239e049b256c772ddeaf4..3dc30e92beaf6bf6219b0bfc89723ee0b3b9167c 100644 (file)
@@ -1184,6 +1184,7 @@ list_arg_vars(exarg_T *eap, char_u *arg, int *first)
     char_u     *arg_subsc;
     char_u     *tofree;
     typval_T    tv;
+    int                prev_uncaught_emsg = uncaught_emsg;
 
     while (!ends_excmd2(eap->cmd, arg) && !got_int)
     {
@@ -1193,7 +1194,7 @@ list_arg_vars(exarg_T *eap, char_u *arg, int *first)
            if (!VIM_ISWHITE(*arg) && !ends_excmd(*arg))
            {
                emsg_severe = TRUE;
-               if (!error)
+               if (uncaught_emsg == prev_uncaught_emsg)
                    semsg(_(e_trailing_arg), arg);
                break;
            }
index d001d0578153ededaa09b95f33447ee25a07dc1f..5f8879b7e6b1b8a14625ed14d4bc861a33b8da1b 100644 (file)
@@ -279,7 +279,7 @@ func Test_let_errors()
   let l = [1, 2, 3]
   call assert_fails('let l[:] = 5', 'E709:')
 
-  call assert_fails('let x:lnum=5', ['E121:', 'E488:'])
+  call assert_fails('let x:lnum=5', ['E121:', 'E121:'])
   call assert_fails('let v:=5', 'E461:')
   call assert_fails('let [a]', 'E474:')
   call assert_fails('let [a, b] = [', 'E697:')
index e49611216293538c86c19c3f41bfbf5e6036c7ea..71633d7416b7227b6ec49e4314ba9ec6153b13c1 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3342,
 /**/
     3341,
 /**/