diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-03-22 20:49:02 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-03-22 20:49:02 +0100 |
commit | 49f1e9ec3e7f4e1b3572367d02a83c2b6ebbed97 (patch) | |
tree | 715f1f7291ce6c1a8dd544ec0bc7844d13e728b3 /src/userfunc.c | |
parent | da1dbed0dfac00952b42982f8fffa42c4f5ed0c8 (diff) |
patch 8.2.2645: using inline function is not properly testedv8.2.2645
Problem: Using inline function is not properly tested.
Solution: Add test cases, esp. for errors. Minor code improvements.
Diffstat (limited to 'src/userfunc.c')
-rw-r--r-- | src/userfunc.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/userfunc.c b/src/userfunc.c index c9c7bc7911..57669419d2 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -731,13 +731,16 @@ get_function_body( else if (line_arg != NULL && *skipwhite(line_arg) != NUL) nextcmd = line_arg; else if (*p != NUL && *p != (vim9_function ? '#' : '"') - && p_verbose > 0 - && eap->cmdidx != CMD_block) - give_warning2(eap->cmdidx == CMD_def - ? (char_u *)_("W1001: Text found after :enddef: %s") - : (char_u *)_("W22: Text found after :endfunction: %s"), - p, TRUE); - if (nextcmd != NULL) + && (vim9_function || p_verbose > 0)) + { + if (eap->cmdidx == CMD_def) + semsg(_(e_text_found_after_enddef_str), p); + else + give_warning2((char_u *) + _("W22: Text found after :endfunction: %s"), + p, TRUE); + } + if (nextcmd != NULL && *skipwhite(nextcmd) != NUL) { // Another command follows. If the line came from "eap" // we can simply point into it, otherwise we need to |