diff --git a/src/nvim/api/autocmd.c b/src/nvim/api/autocmd.c index 9a8eccd22c..2e19987609 100644 --- a/src/nvim/api/autocmd.c +++ b/src/nvim/api/autocmd.c @@ -131,10 +131,8 @@ Array nvim_get_autocmds(Dict(get_autocmds) *opts, Error *err) continue; } - for (AutoPat *ap = au_get_autopat_for_event(event); - ap != NULL; - ap = ap->next) { - if (ap == NULL || ap->cmds == NULL) { + for (AutoPat *ap = au_get_autopat_for_event(event); ap != NULL; ap = ap->next) { + if (ap->cmds == NULL) { continue; }