patch 9.0.1039: using a <Cmd> mapping CmdlineChanged may be triggered twice

Problem:    Using a <Cmd> mapping CmdlineChanged may be triggered twice.
Solution:   Count the number of times CmdlineChanged is triggered and avoid
            doing it twice. (closes #116820
This commit is contained in:
Bram Moolenaar
2022-12-09 12:21:50 +00:00
parent ffa4e9b43a
commit bb393d8259
5 changed files with 23 additions and 4 deletions

View File

@ -2068,6 +2068,9 @@ apply_autocmds_group(
&& (event == EVENT_WINLEAVE || event == EVENT_BUFLEAVE)))
goto BYPASS_AU;
if (event == EVENT_CMDLINECHANGED)
++aucmd_cmdline_changed_count;
/*
* Save the autocmd_* variables and info about the current buffer.
*/
@ -2088,8 +2091,8 @@ apply_autocmds_group(
if (fname_io == NULL)
{
if (event == EVENT_COLORSCHEME || event == EVENT_COLORSCHEMEPRE
|| event == EVENT_OPTIONSET
|| event == EVENT_MODECHANGED)
|| event == EVENT_OPTIONSET
|| event == EVENT_MODECHANGED)
autocmd_fname = NULL;
else if (fname != NULL && !ends_excmd(*fname))
autocmd_fname = fname;