]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.3189: Vim9: error when using "try|" v8.2.3189
authorBram Moolenaar <Bram@vim.org>
Tue, 20 Jul 2021 17:18:44 +0000 (19:18 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 20 Jul 2021 17:18:44 +0000 (19:18 +0200)
Problem:    Vim9: error when using "try|".
Solution:   Allow for "|" right after a command.

src/ex_docmd.c
src/testdir/test_vim9_script.vim
src/version.c

index 9eb423e0d624fb514f56fa3e8618159d72f1bc45..0273f899ae2098fb8dcfbe38e2f5379f05f4526a 100644 (file)
@@ -3691,7 +3691,7 @@ find_ex_command(
 #ifdef FEAT_EVAL
     if (eap->cmdidx < CMD_SIZE
            && vim9
-           && !IS_WHITE_OR_NUL(*p) && *p != '\n' && *p != '!'
+           && !IS_WHITE_OR_NUL(*p) && *p != '\n' && *p != '!' && *p != '|'
            && (eap->cmdidx < 0 ||
                (cmdnames[eap->cmdidx].cmd_argt & EX_NONWHITE_OK) == 0))
     {
index 037c36d29e59d014d5e5cc7956c8d7f9871929c7..8c80e1801dc0f25b5ef37e2bc2ad19b3a9e48a0f 100644 (file)
@@ -581,6 +581,9 @@ def Test_try_catch_throw()
   endfor
   assert_equal(4, counter)
 
+  # no requirement for spaces before |
+  try|echo 0|catch|endtry
+
   # return in finally after empty catch
   def ReturnInFinally(): number
     try
index 4244d82cacadf962fdbaba50c1e9bbc92864e0ef..94825c19b0104e2f5484aa6b999fc89c2dfb7afe 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3189,
 /**/
     3188,
 /**/