mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 23:18:33 +00:00
vim-patch:8.2.2420: too many problems with using all autocommand events
Problem: Too many problems with using all autocommand events. Solution: Disallow defining an autocommand for all events.9a046fd08b
Delete Test_wipe_cbuffer(). Commitdc5f4a3cc2
should have removed it.
This commit is contained in:
@@ -700,11 +700,15 @@ void do_autocmd(char_u *arg_in, int forceit)
|
||||
last_event = (event_T)-1; // for listing the event name
|
||||
last_group = AUGROUP_ERROR; // for listing the group name
|
||||
if (*arg == '*' || *arg == NUL || *arg == '|') {
|
||||
for (event_T event = (event_T)0; event < (int)NUM_EVENTS;
|
||||
event = (event_T)(event + 1)) {
|
||||
if (do_autocmd_event(event, pat, once, nested, cmd, forceit, group)
|
||||
== FAIL) {
|
||||
break;
|
||||
if (!forceit && *cmd != NUL) {
|
||||
EMSG(_(e_cannot_define_autocommands_for_all_events));
|
||||
} else {
|
||||
for (event_T event = (event_T)0; event < (int)NUM_EVENTS;
|
||||
event = (event_T)(event + 1)) {
|
||||
if (do_autocmd_event(event, pat, once, nested, cmd, forceit, group)
|
||||
== FAIL) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user