From 93e732aabece4c2ef75ec9f2a56d777a036b3a8f Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 21 Apr 2017 20:26:34 +0000 Subject: Make the cmd_find_* functions more obvious when looking for a client, rather than having it inside other functions. Should be no change to the way targets are resolved just yet. --- usr.bin/tmux/cmd-queue.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'usr.bin/tmux/cmd-queue.c') diff --git a/usr.bin/tmux/cmd-queue.c b/usr.bin/tmux/cmd-queue.c index f1f88e0bb9b..2d587aba146 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.50 2017/04/21 18:18:17 nicm Exp $ */ +/* $OpenBSD: cmd-queue.c,v 1.51 2017/04/21 20:26:34 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott @@ -216,11 +216,12 @@ cmdq_fire_command(struct cmdq_item *item) name = cmd->entry->name; if (cmd_find_valid_state(&item->state.tflag)) fsp = &item->state.tflag; - else { - if (cmd_find_current(&fs, item, CMD_FIND_QUIET) != 0) - goto out; + else if (cmd_find_valid_state(&item->shared->current)) + fsp = &item->shared->current; + else if (cmd_find_from_client(&fs, item->client) == 0) fsp = &fs; - } + else + goto out; hooks_insert(fsp->s->hooks, item, fsp, "after-%s", name); } -- cgit v1.2.3-59-g8ed1b