vim-patch:9.1.0713: Newline causes E749 in Ex mode (#30254)

Problem:  Newline causes E749 in Ex mode (after 9.1.0573).
Solution: Don't execute empty command followed by a newline.

closes: vim/vim#15614

2432b4a753

Cherry-pick code change from patch 8.2.3405.
This commit is contained in:
zeertzjq
2024-09-04 06:35:26 +08:00
committed by GitHub
parent 45e76acaa0
commit 7b7c95dac9
2 changed files with 27 additions and 0 deletions

View File

@@ -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) {