]> granicus.if.org Git - vim/commitdiff
patch 8.2.1516: Vim9: error for :exe has wrong line number v8.2.1516
authorBram Moolenaar <Bram@vim.org>
Sun, 23 Aug 2020 14:29:11 +0000 (16:29 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 23 Aug 2020 14:29:11 +0000 (16:29 +0200)
Problem:    Vim9: error for :exe has wrong line number.
Solution:   Set line number before calling do_cmdline_cmd(). (closes #6774)

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

index 05b4e9f0224bef6185234c20ad01979992cc20ef..6417d21ee1e0b4d7e33c1c8d378c27f6ec5ca932 100644 (file)
@@ -2159,8 +2159,9 @@ def Test_execute_cmd()
   echomsg [1, 2, 3] #{a: 1, b: 2}
   assert_match('^\[1, 2, 3\] {''a'': 1, ''b'': 2}$', Screenline(&lines))
 
-  call CheckDefFailure(['execute xxx'], 'E1001:')
-  call CheckDefFailure(['execute "cmd"# comment'], 'E488:')
+  call CheckDefFailure(['execute xxx'], 'E1001:', 1)
+  call CheckDefExecFailure(['execute "tabnext " .. 8'], 'E475:', 1)
+  call CheckDefFailure(['execute "cmd"# comment'], 'E488:', 1)
 enddef
 
 def Test_execute_cmd_vimscript()
index 65b9d0fd721fcf1e23ffa9167af477e1d76a14b3..4c2794af0be5e976f27088e5e79ae231c865aaa4 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1516,
 /**/
     1515,
 /**/
index a49f3d7c6f53b9005816530a938eb435e8ed3b85..53a748e971b993b2213f069bfd0803779ea60fd0 100644 (file)
@@ -1062,7 +1062,10 @@ call_def_function(
                    if (ga.ga_data != NULL)
                    {
                        if (iptr->isn_type == ISN_EXECUTE)
+                       {
+                           SOURCING_LNUM = iptr->isn_lnum;
                            do_cmdline_cmd((char_u *)ga.ga_data);
+                       }
                        else
                        {
                            msg_sb_eol();