changeset 28743:cf6bba7a9b0f v8.2.4896

patch 8.2.4896: expression in command block does not look after NL Commit: https://github.com/vim/vim/commit/a13e7acba9928a9c5e97be28946418d8d4323988 Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 6 21:24:31 2022 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Fri, 06 May 2022 22:30:02 +0200
parents 0b11342bb900
children e2e79020b778
files src/eval.c src/testdir/test_usercommands.vim src/version.c
diffstat 3 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -2175,7 +2175,8 @@ eval_next_non_blank(char_u *arg, evalarg
     *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]))))
     {
--- 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\<CR>", 'xt')
+  call assert_equal('true', g:result)
+
   delcommand EchoCond
   unlet g:result
 
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    4896,
+/**/
     4895,
 /**/
     4894,