From: Bram Moolenaar Date: Fri, 6 May 2022 20:24:31 +0000 (+0100) Subject: patch 8.2.4896: expression in command block does not look after NL X-Git-Tag: v8.2.4896 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a13e7acba9928a9c5e97be28946418d8d4323988;p=vim patch 8.2.4896: expression in command block does not look after NL Problem: Expression in command block does not look after NL when command is typed. Solution: Skip over NL also when not in a script. (closes #10358) --- diff --git a/src/eval.c b/src/eval.c index 18e196f44..317446c76 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2175,7 +2175,8 @@ eval_next_non_blank(char_u *arg, evalarg_T *evalarg, int *getnext) *getnext = FALSE; if (in_vim9script() && evalarg != NULL - && (evalarg->eval_cookie != NULL || evalarg->eval_cctx != NULL) + && (evalarg->eval_cookie != NULL || evalarg->eval_cctx != NULL + || *p == NL) && (*p == NUL || *p == NL || (vim9_comment_start(p) && VIM_ISWHITE(p[-1])))) { diff --git a/src/testdir/test_usercommands.vim b/src/testdir/test_usercommands.vim index 8c588c55e..3cb1c8b3f 100644 --- a/src/testdir/test_usercommands.vim +++ b/src/testdir/test_usercommands.vim @@ -705,6 +705,11 @@ func Test_usercmd_with_block() END call v9.CheckScriptSuccess(lines) call assert_equal('true', g:result) + unlet g:result + + call feedkeys(":EchoCond\", 'xt') + call assert_equal('true', g:result) + delcommand EchoCond unlet g:result diff --git a/src/version.c b/src/version.c index df306852f..d20ecf216 100644 --- a/src/version.c +++ b/src/version.c @@ -746,6 +746,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 4896, /**/ 4895, /**/