mirror of
https://github.com/neovim/neovim.git
synced 2026-01-26 15:11:35 +10:00
Merge pull request #17571 from zeertzjq/pvs-autocmd
Some clang and PVS fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user