]> granicus.if.org Git - vim/commitdiff
patch 8.1.2168: heredoc assignment not skipped in if block v8.1.2168
authorBram Moolenaar <Bram@vim.org>
Wed, 16 Oct 2019 21:34:42 +0000 (23:34 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 16 Oct 2019 21:34:42 +0000 (23:34 +0200)
Problem:    Heredoc assignment not skipped in if block.
Solution:   Check if "skip" is set. (closes #5063)

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

index 08a9cc2e1474c7a8b55cf65bfda21fb9723deeae..eb198fdf9f2f99f4e62c8be7f9db458c07bfd247 100644 (file)
@@ -756,10 +756,13 @@ ex_let_const(exarg_T *eap, int is_const)
        if (l != NULL)
        {
            rettv_list_set(&rettv, l);
-           op[0] = '=';
-           op[1] = NUL;
-           (void)ex_let_vars(eap->arg, &rettv, FALSE, semicolon, var_count,
+           if (!eap->skip)
+           {
+               op[0] = '=';
+               op[1] = NUL;
+               (void)ex_let_vars(eap->arg, &rettv, FALSE, semicolon, var_count,
                                                                is_const, op);
+           }
            clear_tv(&rettv);
        }
     }
index 3bb5748947a4114d197c2152621cdbf9d95a01f5..64d178c675c37b0b714e05a198d2efd3686b3746 100644 (file)
@@ -295,4 +295,12 @@ E
   app
   END
   call assert_equal(['something', 'app'], var1)
+
+  let check = []
+  if 0
+     let check =<< trim END
+       from heredoc
+     END
+  endif
+  call assert_equal([], check)
 endfunc
index 3bcd910c13ce700d71abd5b541716724242f9bd5..4f0e6faa5c89bded057257d663461ebbf3f7a70e 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2168,
 /**/
     2167,
 /**/