diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-09-06 17:10:59 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-09-06 17:10:59 +0200 |
commit | ec1b0968aa90d408a79b5b5dca465f65e69753a1 (patch) | |
tree | 806fdafa3159e5372bd16a5fcc636267f07e06cb /src/ex_docmd.c | |
parent | 01dd6c3732a2f352d598e36336a65049614d7508 (diff) |
patch 8.2.3405: cannot have a comment line in a {} block of a user commandv8.2.3405
Problem: Cannot have a comment line in a {} block of a user command.
Solution: Continue after the line break. (closes #8837)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 58980738f2..c58c414108 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -2807,7 +2807,16 @@ parse_command_modifiers( // ignore comment and empty lines if (comment_start(eap->cmd, starts_with_colon)) + { + // a comment ends at a NL + if (eap->nextcmd == NULL) + { + eap->nextcmd = vim_strchr(eap->cmd, '\n'); + if (eap->nextcmd != NULL) + ++eap->nextcmd; + } return FAIL; + } if (*eap->cmd == NUL) { if (!skip_only) |