diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-14 19:45:54 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-04-15 17:40:31 +0800 |
commit | 3ad8c08acc506555667a070cf83c410ac9334f1e (patch) | |
tree | 7084012f51be3bad6726e5de6f79f7740bf2e104 /src/nvim/eval/userfunc.c | |
parent | 071c455420dec7992a06a55e8bd443b769ded369 (diff) | |
download | rneovim-3ad8c08acc506555667a070cf83c410ac9334f1e.tar.gz rneovim-3ad8c08acc506555667a070cf83c410ac9334f1e.tar.bz2 rneovim-3ad8c08acc506555667a070cf83c410ac9334f1e.zip |
vim-patch:8.2.4770: cannot easily mix expression and heredoc
Problem: Cannot easily mix expression and heredoc.
Solution: Support in heredoc. (Yegappan Lakshmanan, closes vim/vim#10138)
https://github.com/vim/vim/commit/efbfa867a146fcd93fdec2435597aa4ae7f1325c
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'src/nvim/eval/userfunc.c')
-rw-r--r-- | src/nvim/eval/userfunc.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c index 67c73924c8..67b1e53a35 100644 --- a/src/nvim/eval/userfunc.c +++ b/src/nvim/eval/userfunc.c @@ -2483,10 +2483,19 @@ void ex_function(exarg_T *eap) && (!ASCII_ISALNUM(p[2]) || (p[2] == 't' && !ASCII_ISALNUM(p[3]))))) { p = skipwhite(arg + 3); - if (strncmp(p, "trim", 4) == 0) { - // Ignore leading white space. - p = skipwhite(p + 4); - heredoc_trimmed = xstrnsave(theline, (size_t)(skipwhite(theline) - theline)); + while (true) { + if (strncmp(p, "trim", 4) == 0) { + // Ignore leading white space. + p = skipwhite(p + 4); + heredoc_trimmed = xstrnsave(theline, (size_t)(skipwhite(theline) - theline)); + continue; + } + if (strncmp(p, "eval", 4) == 0) { + // Ignore leading white space. + p = skipwhite(p + 4); + continue; + } + break; } skip_until = xstrnsave(p, (size_t)(skiptowhite(p) - p)); do_concat = false; |