mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 14:58:18 +00: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:

committed by
Justin M. Keyes

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);
|
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);
|
||||||
|
if (!eap->skip) {
|
||||||
op[0] = '=';
|
op[0] = '=';
|
||||||
op[1] = NUL;
|
op[1] = NUL;
|
||||||
(void)ex_let_vars(eap->arg, &rettv, false, semicolon, var_count,
|
(void)ex_let_vars(eap->arg, &rettv, false, semicolon, var_count,
|
||||||
is_const, op);
|
is_const, op);
|
||||||
|
}
|
||||||
tv_clear(&rettv);
|
tv_clear(&rettv);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@@ -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
|
||||||
|
Reference in New Issue
Block a user