diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-12-02 15:11:18 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-12-02 15:11:18 +0100 |
commit | 7f76494aac512b1d603d9be4132184241f43872c (patch) | |
tree | 7ab5a33bdedb02690d2f88fa6ccf2a73f575d6bb /src/vim9compile.c | |
parent | ea87069d7814497181483877651aef6d97182120 (diff) | |
download | vim-git-7f76494aac512b1d603d9be4132184241f43872c.tar.gz |
patch 8.2.2081: Vim9: cannot handle a linebreak after "=" in assignmentv8.2.2081
Problem: Vim9: cannot handle a linebreak after "=" in assignment.
Solution: Skip over linebreak. (closes #7407)
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r-- | src/vim9compile.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c index 5b5f8f1af..db5e5c353 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -5670,6 +5670,7 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx) else if (oplen > 0) { int is_const = FALSE; + char_u *wp; // For "var = expr" evaluate the expression. if (var_count == 0) @@ -5694,7 +5695,10 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx) if (new_local) --cctx->ctx_locals.ga_len; instr_count = instr->ga_len; - p = skipwhite(op + oplen); + wp = op + oplen; + p = skipwhite(wp); + if (may_get_next_line_error(wp, &p, cctx) == FAIL) + goto theend; r = compile_expr0_ext(&p, cctx, &is_const); if (new_local) ++cctx->ctx_locals.ga_len; @@ -5712,7 +5716,7 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx) // For "[var, var] = expr" get the "var_idx" item from the // list. if (generate_GETITEM(cctx, var_idx) == FAIL) - return FAIL; + goto theend; } rhs_type = stack->ga_len == 0 ? &t_void |