To: vim_dev@googlegroups.com Subject: Patch 8.2.3634 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///