mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.3634: error for already defined function uses wrong line number
Problem: Error for already defined function uses wrong line number. Solution: Set SOURCING_LNUM before giving the error message. (closes #9085)
This commit is contained in:
parent
a755fdbe80
commit
d604d78e7b
@ -741,7 +741,18 @@ def Test_nested_global_function()
|
||||
enddef
|
||||
defcompile
|
||||
END
|
||||
CheckScriptFailure(lines, "E1073:")
|
||||
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()
|
||||
|
@ -4256,6 +4256,7 @@ define_function(exarg_T *eap, char_u *name_arg)
|
||||
&& (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
|
||||
|
@ -757,6 +757,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
3634,
|
||||
/**/
|
||||
3633,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user