diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-06-27 21:18:00 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-06-27 21:18:00 +0200 |
commit | 9215f01218b2ed2cfe49c1f43fcf342bd9ffdded (patch) | |
tree | f2012a07fa1a29ccfde4ecfd1010949ff81e5526 /src/dict.c | |
parent | 7a4981b93642b5b62018cd8150b3fb0dfa2417d4 (diff) | |
download | vim-git-9215f01218b2ed2cfe49c1f43fcf342bd9ffdded.tar.gz |
patch 8.2.1074: Vim9: no line break allowed after some operatorsv8.2.1074
Problem: Vim9: no line break allowed after some operators.
Solution: Skip a line break after the operator. Add
eval_may_get_next_line() to simplify checking for a line break.
Diffstat (limited to 'src/dict.c')
-rw-r--r-- | src/dict.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/dict.c b/src/dict.c index be3282d37..079eb3e11 100644 --- a/src/dict.c +++ b/src/dict.c @@ -805,7 +805,6 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal) char_u buf[NUMBUFLEN]; int vim9script = current_sctx.sc_version == SCRIPT_VERSION_VIM9; int had_comma; - int getnext; /* * First check if it's not a curly-braces thing: {expr}. @@ -831,10 +830,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal) tvkey.v_type = VAR_UNKNOWN; tv.v_type = VAR_UNKNOWN; - *arg = skipwhite(*arg + 1); - eval_next_non_blank(*arg, evalarg, &getnext); - if (getnext) - *arg = eval_next_line(evalarg); + *arg = skipwhite_and_linebreak(*arg + 1, evalarg); while (**arg != '}' && **arg != NUL) { if ((literal @@ -866,10 +862,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal) goto failret; } - *arg = skipwhite(*arg + 1); - eval_next_non_blank(*arg, evalarg, &getnext); - if (getnext) - *arg = eval_next_line(evalarg); + *arg = skipwhite_and_linebreak(*arg + 1, evalarg); if (eval1(arg, &tv, evalarg) == FAIL) // recursive! { if (evaluate) @@ -911,9 +904,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal) } // the "}" can be on the next line - eval_next_non_blank(*arg, evalarg, &getnext); - if (getnext) - *arg = eval_next_line(evalarg); + *arg = skipwhite_and_linebreak(*arg, evalarg); if (**arg == '}') break; if (!had_comma) |