patch 8.2.3189: Vim9: error when using "try|"
Problem: Vim9: error when using "try|".
Solution: Allow for "|" right after a command.
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 9eb423e..0273f89 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -3691,7 +3691,7 @@
#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))
{
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim
index 037c36d..8c80e18 100644
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -581,6 +581,9 @@
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
diff --git a/src/version.c b/src/version.c
index 4244d82..94825c1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -756,6 +756,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3189,
+/**/
3188,
/**/
3187,