From bad5b2f8cf03c6cec690e29b937aac2bb7f2d1e0 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 18 Jun 2017 15:53:53 +0300 Subject: eval: Error out when there is something after :endfunction Ref #6844 --- src/nvim/eval.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index baa61a26bc..c424cfcd80 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -19842,8 +19842,16 @@ void ex_function(exarg_T *eap) /* Check for "endfunction". */ if (checkforcmd(&p, "endfunction", 4) && nesting-- == 0) { - if (line_arg == NULL) + if (*p == '!') { + p++; + } + p += strspn((const char *)p, " \t\r\n"); + if (*p != NUL && *p != '"') { + emsgf(_(e_trailing2), p); + } + if (line_arg == NULL) { xfree(theline); + } break; } -- cgit