summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-06-15 20:06:34 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-15 20:06:34 +0200
commit8ac681a280ffae14c30784a54587ad6cb640afbb (patch)
tree01189333fc67f2c62054a481b90c53dcb4584e91
parent968a5b62ffd3e08005d907d93eaaf807be466a88 (diff)
patch 8.2.3004: Vim9: error for missing colon given while skippingv8.2.3004
Problem: Vim9: error for missing colon given while skipping. Solution: Do not give the error when skipping. (closes #8385)
-rw-r--r--src/ex_docmd.c2
-rw-r--r--src/testdir/test_vim9_script.vim13
-rw-r--r--src/version.c2
3 files changed, 16 insertions, 1 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 25ec9c3fdb..45f94017f2 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1844,7 +1844,7 @@ do_one_cmd(
// If a ':' before the range is missing, give a clearer error
// message.
- if (ar > ea.cmd)
+ if (ar > ea.cmd && !ea.skip)
{
semsg(_(e_colon_required_before_range_str), ea.cmd);
goto doend;
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim
index d5951c647a..9237fdfad8 100644
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -590,6 +590,19 @@ def Test_try_catch_throw()
return 2
enddef
assert_equal(4, ReturnInFinally())
+
+ var lines =<< trim END
+ vim9script
+ try
+ acos('0.5')
+ ->setline(1)
+ catch
+ g:caught = v:exception
+ endtry
+ END
+ CheckScriptSuccess(lines)
+ assert_match('E808: Number or Float required', g:caught)
+ unlet g:caught
enddef
" :while at the very start of a function that :continue jumps to
diff --git a/src/version.c b/src/version.c
index 7711978fc8..e8b0ddcf0b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3004,
+/**/
3003,
/**/
3002,