vim-patch:9.1.0312: heredocs are not supported for :commands

Problem:  heredocs are not supported for :commands
          (balki)
Solution: Add heredoc support
          (Yegappan Lakshmanan)

fixes: vim/vim#14491
closes: vim/vim#14528

e74cad3321

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
zeertzjq
2024-04-13 05:55:51 +08:00
parent b87212e669
commit 617a385142
3 changed files with 78 additions and 18 deletions

View File

@@ -1045,13 +1045,27 @@ char *skiptowhite(const char *p)
return (char *)p;
}
/// Skip over text until ' ' or '\t' or newline or NUL
///
/// @param[in] p Text to skip over.
///
/// @return Pointer to the next whitespace or newline or NUL character.
char *skiptowhite_or_nl(const char *p)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE
{
while (*p != ' ' && *p != '\t' && *p != NL && *p != NUL) {
p++;
}
return (char *)p;
}
/// skiptowhite_esc: Like skiptowhite(), but also skip escaped chars
///
/// @param p
///
/// @return Pointer to the next whitespace character.
char *skiptowhite_esc(const char *p)
FUNC_ATTR_PURE
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE
{
while (*p != ' ' && *p != '\t' && *p != NUL) {
if (((*p == '\\') || (*p == Ctrl_V)) && (*(p + 1) != NUL)) {