0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 9.1.0582: Printed line doesn't overwrite colon when pressing Enter in Ex mode

Problem:  Printed line no longer overwrites colon when pressing Enter in
          Ex mode (after 9.1.0573).
Solution: Restore the behavior of pressing Enter in Ex mode.
          (zeertzjq)

closes: #15258

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2024-07-14 10:22:54 +02:00
committed by Christian Brabandt
parent d9be94cf03
commit 7d664bf0eb
3 changed files with 20 additions and 5 deletions

View File

@@ -2721,6 +2721,12 @@ ex_errmsg(char *msg, char_u *arg)
return ex_error_buf;
}
/*
* 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;
}