summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/cmd-queue.c')
-rw-r--r--usr.bin/tmux/cmd-queue.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/usr.bin/tmux/cmd-queue.c b/usr.bin/tmux/cmd-queue.c
index 84976d3c74f..3da374c8d48 100644
--- a/usr.bin/tmux/cmd-queue.c
+++ b/usr.bin/tmux/cmd-queue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-queue.c,v 1.67 2019/05/20 11:46:06 nicm Exp $ */
+/* $OpenBSD: cmd-queue.c,v 1.68 2019/05/23 11:13:30 nicm Exp $ */
/*
* Copyright (c) 2013 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -175,15 +175,6 @@ cmdq_remove(struct cmdq_item *item)
free(item);
}
-/* Set command group. */
-static u_int
-cmdq_next_group(void)
-{
- static u_int group;
-
- return (++group);
-}
-
/* Remove all subsequent items that match this item's group. */
static void
cmdq_remove_group(struct cmdq_item *item)
@@ -206,7 +197,6 @@ cmdq_get_command(struct cmd_list *cmdlist, struct cmd_find_state *current,
{
struct cmdq_item *item, *first = NULL, *last = NULL;
struct cmd *cmd;
- u_int group = cmdq_next_group();
struct cmdq_shared *shared;
shared = xcalloc(1, sizeof *shared);
@@ -222,13 +212,15 @@ cmdq_get_command(struct cmd_list *cmdlist, struct cmd_find_state *current,
xasprintf(&item->name, "[%s/%p]", cmd->entry->name, item);
item->type = CMDQ_COMMAND;
- item->group = group;
+ item->group = cmd->group;
item->flags = flags;
item->shared = shared;
item->cmdlist = cmdlist;
item->cmd = cmd;
+ log_debug("%s: %s group %u", __func__, item->name, item->group);
+
shared->references++;
cmdlist->references++;