Patch 8.2.3634
Problem: Error for already defined function uses wrong line number.
Solution: Set SOURCING_LNUM before giving the error message. (closes #9085)
Files: src/userfunc.c, src/testdir/test_vim9_func.vim
*** ../vim-8.2.3633/src/userfunc.c 2021-11-20 21:35:37.237124052 +0000
--- src/userfunc.c 2021-11-20 21:45:48.408636952 +0000
***************
*** 4256,4261 ****
--- 4256,4262 ----
&& (fp->uf_script_ctx.sc_sid != current_sctx.sc_sid
|| fp->uf_script_ctx.sc_seq == current_sctx.sc_seq)))
{
+ SOURCING_LNUM = sourcing_lnum_top;
if (vim9script)
emsg_funcname(e_name_already_defined_str, name);
else
*** ../vim-8.2.3633/src/testdir/test_vim9_func.vim 2021-11-20
21:35:37.237124052 +0000
--- src/testdir/test_vim9_func.vim 2021-11-20 21:45:18.556660833 +0000
***************
*** 741,747 ****
enddef
defcompile
END
! CheckScriptFailure(lines, "E1073:")
enddef
def DefListAll()
--- 741,758 ----
enddef
defcompile
END
! CheckScriptFailure(lines, "E1073:", 1)
!
! lines =<< trim END
! vim9script
! def Func()
! echo 'script'
! enddef
! def Func()
! echo 'script'
! enddef
! END
! CheckScriptFailure(lines, "E1073:", 5)
enddef
def DefListAll()
*** ../vim-8.2.3633/src/version.c 2021-11-20 21:35:37.241124049 +0000
--- src/version.c 2021-11-20 21:42:15.612807116 +0000
***************
*** 759,760 ****
--- 759,762 ----
{ /* Add new patch number below this line */
+ /**/
+ 3634,
/**/
--
ARTHUR: Charge!
[They all charge with swords drawn towards the RABBIT. A tremendous twenty
second fight with Peckinpahish shots and borrowing heavily also on the
Kung Fu and karate-type films ensues, in which some four KNIGHTS are
comprehensively killed.]
ARTHUR: Run away! Run away!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20211120214648.A61711C044E%40moolenaar.net.