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)
diff --git a/src/userfunc.c b/src/userfunc.c
index 54335d4..772d45d 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -4058,7 +4058,11 @@
}
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;
}
}