0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.2758: Vim9: wrong line number for autoload function with wrong name

Problem:    Vim9: wrong line number for autoload function with wrong name.
Solution:   Set and restore SOURCING_LNUM. (closes #8100)
This commit is contained in:
Bram Moolenaar
2021-04-12 22:02:36 +02:00
parent 68452177ca
commit f48b2fa33c
3 changed files with 30 additions and 0 deletions

View File

@@ -4058,7 +4058,11 @@ define_function(exarg_T *eap, char_u *name_arg)
}
if (j == FAIL)
{
linenr_T save_lnum = SOURCING_LNUM;
SOURCING_LNUM = sourcing_lnum_top;
semsg(_("E746: Function name does not match script file name: %s"), name);
SOURCING_LNUM = save_lnum;
goto erret;
}
}