diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-07-28 21:25:49 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-28 21:25:49 +0200 |
commit | 81530e36033dec2c2cd94af6dd48ceb0389e95a2 (patch) | |
tree | 3dc9d5809dcad4596602f26e3a4b66453c089fc1 /src/evalvars.c | |
parent | d47c39775b8d381005751b7b20da56412dafb5e4 (diff) |
patch 8.2.3239: Vim9: no error using heredoc for a number variablev8.2.3239
Problem: Vim9: no error using heredoc for a number variable.
Solution: Add a type check. (closes #8627)
Diffstat (limited to 'src/evalvars.c')
-rw-r--r-- | src/evalvars.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/evalvars.c b/src/evalvars.c index 534163c543..dc747f717a 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -817,6 +817,7 @@ ex_let(exarg_T *eap) else if (expr[0] == '=' && expr[1] == '<' && expr[2] == '<') { list_T *l; + long cur_lnum = SOURCING_LNUM; // HERE document l = heredoc_get(eap, expr + 3, FALSE); @@ -825,6 +826,8 @@ ex_let(exarg_T *eap) rettv_list_set(&rettv, l); if (!eap->skip) { + // errors are for the assignment, not the end marker + SOURCING_LNUM = cur_lnum; op[0] = '='; op[1] = NUL; (void)ex_let_vars(eap->arg, &rettv, FALSE, semicolon, var_count, |