summaryrefslogtreecommitdiff
path: root/src/userfunc.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-22 19:12:10 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-22 19:12:10 +0200
commit663bb2331626944cea156374858131fcd323b9e9 (patch)
treea6cc8157e602bbfc3903dec711f82db3bc8dcb56 /src/userfunc.c
parentc768a208ca8e0e0fec900c18d5d9a593357ad793 (diff)
downloadvim-git-663bb2331626944cea156374858131fcd323b9e9.tar.gz
patch 8.0.0654: no warning for text after :endfunctionv8.0.0654
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.
Diffstat (limited to 'src/userfunc.c')
-rw-r--r--src/userfunc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index 859e6ebec..de089bb68 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -2130,6 +2130,14 @@ ex_function(exarg_T *eap)
/* 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;