neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit f015994a42be804fefc17e1ffd8aeb069b44b945
parent 85de9b06ed529ee60beb06c2e54b0c517463f28a
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Thu,  3 Mar 2022 08:25:28 +0800

Merge pull request #17571 from zeertzjq/pvs-autocmd

Some clang and PVS fixes
Diffstat:
Msrc/nvim/api/autocmd.c | 13++-----------
Msrc/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 @@ -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 @@ -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);