diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-16 23:34:42 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-16 23:34:42 +0200 |
commit | b1ba9abcb385b0a5355788a7eefef78ec68d2f65 (patch) | |
tree | 953fc851b89d02cf229464c209044390cb986855 | |
parent | 2559a47823a6a7827631f2e6a0176d7afce2721c (diff) | |
download | vim-git-b1ba9abcb385b0a5355788a7eefef78ec68d2f65.tar.gz |
patch 8.1.2168: heredoc assignment not skipped in if blockv8.1.2168
Problem: Heredoc assignment not skipped in if block.
Solution: Check if "skip" is set. (closes #5063)
-rw-r--r-- | src/evalvars.c | 9 | ||||
-rw-r--r-- | src/testdir/test_let.vim | 8 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 16 insertions, 3 deletions
diff --git a/src/evalvars.c b/src/evalvars.c index 08a9cc2e1..eb198fdf9 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -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); } } diff --git a/src/testdir/test_let.vim b/src/testdir/test_let.vim index 3bb574894..64d178c67 100644 --- a/src/testdir/test_let.vim +++ b/src/testdir/test_let.vim @@ -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 diff --git a/src/version.c b/src/version.c index 3bcd910c1..4f0e6faa5 100644 --- a/src/version.c +++ b/src/version.c @@ -754,6 +754,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2168, +/**/ 2167, /**/ 2166, |