patch 8.2.2265: error message for missing endfunc/enddef is last line
Problem: Error message for missing endfunc/enddef is last line.
Solution: Report the line where the function starts. (closes #7582)
diff --git a/src/userfunc.c b/src/userfunc.c
index f0877e1..5fab412 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -3352,6 +3352,8 @@
lines_left = Rows - 1;
if (theline == NULL)
{
+ // Use the start of the function for the line number.
+ SOURCING_LNUM = sourcing_lnum_top;
if (skip_until != NULL)
semsg(_(e_missing_heredoc_end_marker_str), skip_until);
else if (eap->cmdidx == CMD_def)