diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-12-09 12:21:50 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-12-09 12:21:50 +0000 |
commit | bb393d8259af8aec095e96d81624a16ed9f25005 (patch) | |
tree | 3d932f3f5377e4e902a7ae731e4b4b75f1bbe5c1 /src/autocmd.c | |
parent | ffa4e9b43a3d6d7f412f54637a4b1076ed2bc2f4 (diff) |
patch 9.0.1039: using a <Cmd> mapping CmdlineChanged may be triggered twicev9.0.1039
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
Diffstat (limited to 'src/autocmd.c')
-rw-r--r-- | src/autocmd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/autocmd.c b/src/autocmd.c index aca990cb51..20c5afa744 100644 --- a/src/autocmd.c +++ b/src/autocmd.c @@ -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; |