vim-patch:9.1.0287: Vim9: comment may be treated as heredoc start (#28257)

Problem:  Vim9: comment may be treated as heredoc start.
          (Ernie Rael)
Solution: Use skip_var_list() instead of find_name_end().
          (zeertzjq)

fixes: vim/vim#14444
closes: vim/vim#14446

9a91d2b72c
This commit is contained in:
zeertzjq
2024-04-10 06:07:29 +08:00
committed by GitHub
parent f398552eb1
commit efb6640b29
2 changed files with 59 additions and 3 deletions

View File

@@ -2576,10 +2576,14 @@ void ex_function(exarg_T *eap)
// and ":let [a, b] =<< [trim] EOF"
arg = p;
if (checkforcmd(&arg, "let", 2)) {
while (vim_strchr("$@&", *arg) != NULL) {
arg++;
int var_count = 0;
int semicolon = 0;
const char *argend = skip_var_list(arg, &var_count, &semicolon, true);
if (argend == NULL) {
// Invalid list assignment: skip to closing bracket.
argend = find_name_end(arg, NULL, NULL, FNE_INCL_BR);
}
arg = skipwhite(find_name_end(arg, NULL, NULL, FNE_INCL_BR));
arg = skipwhite(argend);
if (arg[0] == '=' && arg[1] == '<' && arg[2] == '<') {
p = skipwhite(arg + 3);
while (true) {