aboutsummaryrefslogtreecommitdiff
path: root/popup.c
diff options
context:
space:
mode:
authornicm <nicm>2020-04-13 15:55:51 +0000
committernicm <nicm>2020-04-13 15:55:51 +0000
commit3f86d6d46014ca55e42cecd570d7f269b1d386b3 (patch)
tree94a72dc0995badc04a7471edb4782ce9707a4930 /popup.c
parentadb76fd1ce8753a958d4ffe14db724f9f4d674ea (diff)
downloadrtmux-3f86d6d46014ca55e42cecd570d7f269b1d386b3.tar.gz
rtmux-3f86d6d46014ca55e42cecd570d7f269b1d386b3.tar.bz2
rtmux-3f86d6d46014ca55e42cecd570d7f269b1d386b3.zip
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 'popup.c')
-rw-r--r--popup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/popup.c b/popup.c
index c1530347..c2db145c 100644
--- a/popup.c
+++ b/popup.c
@@ -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;