Skip to content

Commit 430deb1

Browse files
committed
patch 8.2.1516: Vim9: error for :exe has wrong line number
Problem: Vim9: error for :exe has wrong line number. Solution: Set line number before calling do_cmdline_cmd(). (closes #6774)
1 parent 8436773 commit 430deb1

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/testdir/test_vim9_script.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,8 +2159,9 @@ def Test_execute_cmd()
21592159
echomsg [1, 2, 3] #{a: 1, b: 2}
21602160
assert_match('^\[1, 2, 3\] {''a'': 1, ''b'': 2}$', Screenline(&lines))
21612161

2162-
call CheckDefFailure(['execute xxx'], 'E1001:')
2163-
call CheckDefFailure(['execute "cmd"# comment'], 'E488:')
2162+
call CheckDefFailure(['execute xxx'], 'E1001:', 1)
2163+
call CheckDefExecFailure(['execute "tabnext " .. 8'], 'E475:', 1)
2164+
call CheckDefFailure(['execute "cmd"# comment'], 'E488:', 1)
21642165
enddef
21652166

21662167
def Test_execute_cmd_vimscript()

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ static char *(features[]) =
754754

755755
static int included_patches[] =
756756
{ /* Add new patch number below this line */
757+
/**/
758+
1516,
757759
/**/
758760
1515,
759761
/**/

src/vim9execute.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,10 @@ call_def_function(
10621062
if (ga.ga_data != NULL)
10631063
{
10641064
if (iptr->isn_type == ISN_EXECUTE)
1065+
{
1066+
SOURCING_LNUM = iptr->isn_lnum;
10651067
do_cmdline_cmd((char_u *)ga.ga_data);
1068+
}
10661069
else
10671070
{
10681071
msg_sb_eol();

0 commit comments

Comments
 (0)