vim-patch:8.2.4948: cannot use Perl heredoc in nested :def function (#32311)

Problem:    Cannot use Perl heredoc in nested :def function. (Virginia
            Senioria)
Solution:   Only concatenate heredoc lines when not in a nested function.
            (closes vim/vim#10415)

d881d15984

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2025-02-03 12:49:33 +08:00
committed by GitHub
parent efa3677f28
commit 0c8890e7a7

View File

@@ -2471,6 +2471,7 @@ static int get_function_body(exarg_T *eap, garray_T *newlines, char *line_arg_in
is_heredoc = true;
}
if (!is_heredoc) {
// Check for ":let v =<< [trim] EOF"
// and ":let [a, b] =<< [trim] EOF"
arg = p;
@@ -2504,6 +2505,7 @@ static int get_function_body(exarg_T *eap, garray_T *newlines, char *line_arg_in
}
}
}
}
// Add the line to the function.
ga_grow(newlines, 1 + (int)sourcing_lnum_off);