summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/popup.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-04-13 15:55:52 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-04-13 15:55:52 +0000
commitbbcd02d308c01313ff44ba41376758f81178d8ab (patch)
treec6cbb71bd44cf5c395891b8b7ae04c6fc330e498 /usr.bin/tmux/popup.c
parent209c1b999f121d23cb4604659577998e9c854d0c (diff)
When adding a list of commands to the queue, instead of automatically
creating a new state for each group of commands, require the caller to create one and use it for all the commands in the list. This means the current target works even with list with multiple groups (which can happen if they are defined with newlines).
Diffstat (limited to 'usr.bin/tmux/popup.c')
-rw-r--r--usr.bin/tmux/popup.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/tmux/popup.c b/usr.bin/tmux/popup.c
index 02d5a458201..529c8fa06e6 100644
--- a/usr.bin/tmux/popup.c
+++ b/usr.bin/tmux/popup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: popup.c,v 1.11 2020/04/13 14:46:04 nicm Exp $ */
+/* $OpenBSD: popup.c,v 1.12 2020/04/13 15:55:51 nicm Exp $ */
/*
* Copyright (c) 2020 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -223,6 +223,7 @@ popup_key_cb(struct client *c, struct key_event *event)
struct mouse_event *m = &event->m;
struct cmd_find_state *fs = &pd->fs;
struct cmdq_item *new_item;
+ struct cmdq_state *new_state;
struct cmd_parse_result *pr;
struct format_tree *ft;
const char *cmd, *buf;
@@ -308,7 +309,9 @@ popup_key_cb(struct client *c, struct key_event *event)
event = cmdq_get_event(pd->item);
else
event = NULL;
- new_item = cmdq_get_command(pr->cmdlist, fs, event, 0);
+ new_state = cmdq_new_state(&pd->fs, event, 0);
+ new_item = cmdq_get_command(pr->cmdlist, new_state);
+ cmdq_free_state(new_state);
cmd_list_free(pr->cmdlist);
cmdq_append(c, new_item);
break;