int text_indent_len = 0;
char_u *text_indent = NULL;
char_u dot[] = ".";
+ int comment_char = in_vim9script() ? '#' : '"';
if (eap->getline == NULL)
{
}
// The marker is the next word.
- if (*cmd != NUL && *cmd != '"')
+ if (*cmd != NUL && *cmd != comment_char)
{
marker = skipwhite(cmd);
p = skiptowhite(marker);
- if (*skipwhite(p) != NUL && *skipwhite(p) != '"')
+ if (*skipwhite(p) != NUL && *skipwhite(p) != comment_char)
{
semsg(_(e_trailing_arg), p);
return NULL;
CheckScriptSuccess(lines)
enddef
+def Test_heredoc()
+ var lines =<< trim END # comment
+ text
+ END
+ assert_equal(['text'], lines)
+
+ CheckDefFailure(['var lines =<< trim END X', 'END'], 'E488:')
+ CheckDefFailure(['var lines =<< trim END " comment', 'END'], 'E488:')
+enddef
+
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1755,
/**/
1754,
/**/
eap->getline = exarg_getline;
eap->cookie = cctx;
l = heredoc_get(eap, op + 3, FALSE);
+ if (l == NULL)
+ return NULL;
if (cctx->ctx_skip != SKIP_YES)
{