aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index fd83bc846b..e08e129656 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -21742,22 +21742,31 @@ void ex_function(exarg_T *eap)
}
// Check for ":let v =<< [trim] EOF"
+ // and ":let [a, b] =<< [trim] EOF"
arg = skipwhite(skiptowhite(p));
- arg = skipwhite(skiptowhite(arg));
- if (arg[0] == '=' && arg[1] == '<' && arg[2] =='<'
- && ((p[0] == 'l' && p[1] == 'e'
- && (!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 = vim_strnsave(theline,
- (int)(skipwhite(theline) - theline));
+ if (*arg == '[') {
+ arg = vim_strchr(arg, ']');
+ }
+ if (arg != NULL) {
+ arg = skipwhite(skiptowhite(arg));
+ if (arg[0] == '='
+ && arg[1] == '<'
+ && arg[2] =='<'
+ && (p[0] == 'l'
+ && p[1] == 'e'
+ && (!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 =
+ vim_strnsave(theline, (int)(skipwhite(theline) - theline));
+ }
+ skip_until = vim_strnsave(p, (int)(skiptowhite(p) - p));
+ do_concat = false;
+ is_heredoc = true;
}
- skip_until = vim_strnsave(p, (int)(skiptowhite(p) - p));
- do_concat = false;
- is_heredoc = true;
}
}