aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index b5a5a0f466..80bc31a1d2 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -2499,6 +2499,17 @@ int parse_command_modifiers(exarg_T *eap, const char **errormsg, cmdmod_T *cmod,
// ignore comment and empty lines
if (*eap->cmd == '"') {
+ // 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->nextcmd == NULL && *eap->cmd == '\n') {
+ eap->nextcmd = eap->cmd + 1;
return FAIL;
}
if (*eap->cmd == NUL) {