mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 10:26:31 +00:00
vim-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 vim/vim#12578)
590aae3557
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -1784,11 +1784,13 @@ bool apply_autocmds_group(event_T event, char *fname, char *fname_io, bool force
|
|||||||
}
|
}
|
||||||
|
|
||||||
const int save_did_emsg = did_emsg;
|
const int save_did_emsg = did_emsg;
|
||||||
|
const bool save_ex_pressedreturn = get_pressedreturn();
|
||||||
|
|
||||||
// Execute the autocmd. The `getnextac` callback handles iteration.
|
// Execute the autocmd. The `getnextac` callback handles iteration.
|
||||||
do_cmdline(NULL, getnextac, &patcmd, DOCMD_NOWAIT | DOCMD_VERBOSE | DOCMD_REPEAT);
|
do_cmdline(NULL, getnextac, &patcmd, DOCMD_NOWAIT | DOCMD_VERBOSE | DOCMD_REPEAT);
|
||||||
|
|
||||||
did_emsg += save_did_emsg;
|
did_emsg += save_did_emsg;
|
||||||
|
set_pressedreturn(save_ex_pressedreturn);
|
||||||
|
|
||||||
if (nesting == 1) {
|
if (nesting == 1) {
|
||||||
// restore cursor and topline, unless they were changed
|
// restore cursor and topline, unless they were changed
|
||||||
|
@@ -244,6 +244,12 @@ func Test_ex_mode_errors()
|
|||||||
|
|
||||||
au! CmdLineEnter
|
au! CmdLineEnter
|
||||||
delfunc ExEnterFunc
|
delfunc ExEnterFunc
|
||||||
|
|
||||||
|
au CmdlineEnter * :
|
||||||
|
call feedkeys("gQecho 1\r", 'xt')
|
||||||
|
|
||||||
|
au! CmdlineEnter
|
||||||
|
|
||||||
quit
|
quit
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user