mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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:
parent
6fd6f4683d
commit
2e4465e058
@ -1675,10 +1675,12 @@ static void ex_let_const(exarg_T *eap, const bool is_const)
|
||||
list_T *l = heredoc_get(eap, expr + 3);
|
||||
if (l != NULL) {
|
||||
tv_list_set_ret(&rettv, l);
|
||||
op[0] = '=';
|
||||
op[1] = NUL;
|
||||
(void)ex_let_vars(eap->arg, &rettv, false, semicolon, var_count,
|
||||
is_const, op);
|
||||
if (!eap->skip) {
|
||||
op[0] = '=';
|
||||
op[1] = NUL;
|
||||
(void)ex_let_vars(eap->arg, &rettv, false, semicolon, var_count,
|
||||
is_const, op);
|
||||
}
|
||||
tv_clear(&rettv);
|
||||
}
|
||||
} else {
|
||||
|
@ -276,4 +276,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
|
||||
|
Loading…
Reference in New Issue
Block a user