0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 9.0.1665: empty CmdlineEnter autocommand causes errors in Ex mode

Problem:    Empty CmdlineEnter autocommand causes errors in Ex mode.
Solution:   Save and restore ex_pressedreturn. (Christian Brabandt,
            closes # 12581, closes #12578)
This commit is contained in:
Christian Brabandt 2023-06-25 22:34:22 +01:00 committed by Bram Moolenaar
parent 8154e642aa
commit 590aae3557
4 changed files with 11 additions and 4 deletions

View File

@ -2018,7 +2018,6 @@ apply_autocmds_group(
int did_save_redobuff = FALSE;
save_redo_T save_redo;
int save_KeyTyped = KeyTyped;
int save_did_emsg;
ESTACK_CHECK_DECLARATION;
/*
@ -2310,12 +2309,14 @@ apply_autocmds_group(
else
check_lnums_nested(TRUE);
save_did_emsg = did_emsg;
int save_did_emsg = did_emsg;
int save_ex_pressedreturn = get_pressedreturn();
do_cmdline(NULL, getnextac, (void *)&patcmd,
DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT);
did_emsg += save_did_emsg;
set_pressedreturn(save_ex_pressedreturn);
if (nesting == 1)
// restore cursor and topline, unless they were changed

View File

@ -9840,7 +9840,6 @@ is_loclist_cmd(int cmdidx)
}
#endif
#if defined(FEAT_TIMERS) || defined(PROTO)
int
get_pressedreturn(void)
{
@ -9852,4 +9851,3 @@ set_pressedreturn(int val)
{
ex_pressedreturn = val;
}
#endif

View File

@ -239,6 +239,12 @@ func Test_ex_mode_errors()
au! CmdLineEnter
delfunc ExEnterFunc
au CmdlineEnter * :
call feedkeys("gQecho 1\r", 'xt')
au! CmdlineEnter
quit
endfunc

View File

@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1665,
/**/
1664,
/**/