diff options
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 53f9d1af2c..e6200ed706 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -2722,6 +2722,12 @@ ex_errmsg(char *msg, char_u *arg) } /* + * The "+" string used in place of an empty command in Ex mode. + * This string is used in pointer comparison. + */ +static char exmode_plus[] = "+"; + +/* * Handle a range without a command. * Returns an error message on failure. */ @@ -2730,7 +2736,8 @@ ex_range_without_command(exarg_T *eap) { char *errormsg = NULL; - if ((*eap->cmd == '|' || exmode_active) + if ((*eap->cmd == '|' || + (exmode_active && eap->cmd != (char_u *)exmode_plus + 1)) #ifdef FEAT_EVAL && !in_vim9script() #endif @@ -3212,7 +3219,7 @@ parse_command_modifiers( eap->cmd = orig_cmd; } else if (use_plus_cmd) - eap->cmd = (char_u *)"+"; + eap->cmd = (char_u *)exmode_plus; return OK; } |