From a1f59a2d76a57c5276ccbc5461b7096611ef5d24 Mon Sep 17 00:00:00 2001 From: Konst Mayer Date: Sat, 18 Nov 2023 23:05:36 +0700 Subject: Change :autocmd! behavior to match documentation According to the man page if {cmd} is used with :autocmd!, a new autocommand (with the same rules) is created for {cmd}. Also removed some unnecessary code (cmd variable is free'd a few lines below, so there is no need to clear its bits). --- src/autocmd.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/autocmd.c b/src/autocmd.c index 8e6af79..025567d 100644 --- a/src/autocmd.c +++ b/src/autocmd.c @@ -211,8 +211,6 @@ gboolean autocmd_add(Client *c, char *name, gboolean delete) if (!util_wildmatch(pattern, cmd->pattern)) { continue; } - /* remove the bits from the item */ - cmd->bits &= ~bits; /* if the command has no matching events - remove it */ grp->cmds = g_slist_delete_link(grp->cmds, lc); @@ -225,8 +223,6 @@ gboolean autocmd_add(Client *c, char *name, gboolean delete) if (removed) { rebuild_used_bits(c); } - - return true; } /* add the new autocmd */ -- cgit v1.2.3