]> granicus.if.org Git - vim/commitdiff
patch 8.2.3004: Vim9: error for missing colon given while skipping v8.2.3004
authorBram Moolenaar <Bram@vim.org>
Tue, 15 Jun 2021 18:06:34 +0000 (20:06 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 15 Jun 2021 18:06:34 +0000 (20:06 +0200)
Problem:    Vim9: error for missing colon given while skipping.
Solution:   Do not give the error when skipping. (closes #8385)

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

index 25ec9c3fdbbdb0769766f7f68b9beed693b92cf7..45f94017f25fd740b1b5bde18296097546ca1b74 100644 (file)
@@ -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;
index d5951c647a15e6262b6e21c6d229ae521511d858..9237fdfad8280ea91e70e33a8145eb9fd0d7a13d 100644 (file)
@@ -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
index 7711978fc864ad3d348c51e001a4d7df875f724a..e8b0ddcf0b8e03123e87b305f3175d19c252f989 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3004,
 /**/
     3003,
 /**/