diff options
-rw-r--r-- | src/nvim/api/autocmd.c | 13 | ||||
-rw-r--r-- | src/nvim/autocmd.c | 1 |
2 files changed, 2 insertions, 12 deletions
diff --git a/src/nvim/api/autocmd.c b/src/nvim/api/autocmd.c index 9a8eccd22c..0ad7b320d0 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; } @@ -426,13 +424,6 @@ Integer nvim_create_autocmd(uint64_t channel_id, Object event, Dict(create_autoc ADD(patterns, STRING_OBJ(cstr_to_string((char *)pattern_buflocal))); } - if (aucmd.type == CALLABLE_NONE) { - api_set_error(err, - kErrorTypeValidation, - "'command' or 'callback' is required"); - goto cleanup; - } - if (opts->desc.type != kObjectTypeNil) { if (opts->desc.type == kObjectTypeString) { desc = opts->desc.data.string.data; diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index 66222f6a6a..a36d61420a 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -887,7 +887,6 @@ int do_autocmd_event(event_T event, char_u *pat, bool once, int nested, char_u * while (patlen) { // detect special <buffer[=X]> buffer-local patterns is_buflocal = aupat_is_buflocal(pat, patlen); - buflocal_nr = 0; if (is_buflocal) { buflocal_nr = aupat_get_buflocal_nr(pat, patlen); |