patch 8.0.0654: no warning for text after :endfunction
Problem: Text found after :endfunction is silently ignored.
Solution: Give a warning if 'verbose' is set. When | or \n are used,
execute the text as a command.
diff --git a/src/userfunc.c b/src/userfunc.c
index 859e6eb..de089bb 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -2130,6 +2130,14 @@
/* Check for "endfunction". */
if (checkforcmd(&p, "endfunction", 4) && nesting-- == 0)
{
+ if (*p == '|')
+ /* Another command follows. */
+ eap->nextcmd = vim_strsave(p + 1);
+ else if (line_arg != NULL && *skipwhite(line_arg) != NUL)
+ /* Another command follows. */
+ eap->nextcmd = line_arg;
+ else if (*p != NUL && *p != '"' && p_verbose > 0)
+ EMSG2((char_u *)_("E946: Text found after :endfunction: %s"), p);
if (line_arg == NULL)
vim_free(theline);
break;