vim-patch:8.1.2168: heredoc not skipped in if-block #11265

Problem:    Heredoc assignment not skipped in if block.
Solution:   Check if "skip" is set.

b1ba9abcb3

Fixes https://github.com/neovim/neovim/issues/11264
This commit is contained in:
Marco Hinz
2019-10-21 02:17:25 +02:00
committed by Justin M. Keyes
parent 6fd6f4683d
commit 2e4465e058
2 changed files with 14 additions and 4 deletions

View File

@@ -1675,10 +1675,12 @@ static void ex_let_const(exarg_T *eap, const bool is_const)
list_T *l = heredoc_get(eap, expr + 3); list_T *l = heredoc_get(eap, expr + 3);
if (l != NULL) { if (l != NULL) {
tv_list_set_ret(&rettv, l); tv_list_set_ret(&rettv, l);
op[0] = '='; if (!eap->skip) {
op[1] = NUL; op[0] = '=';
(void)ex_let_vars(eap->arg, &rettv, false, semicolon, var_count, op[1] = NUL;
is_const, op); (void)ex_let_vars(eap->arg, &rettv, false, semicolon, var_count,
is_const, op);
}
tv_clear(&rettv); tv_clear(&rettv);
} }
} else { } else {

View File

@@ -276,4 +276,12 @@ E
app app
END END
call assert_equal(['something', 'app'], var1) call assert_equal(['something', 'app'], var1)
let check = []
if 0
let check =<< trim END
from heredoc
END
endif
call assert_equal([], check)
endfunc endfunc