summaryrefslogtreecommitdiffstats
path: root/key-bindings.c
diff options
context:
space:
mode:
authornicm <nicm>2019-12-19 09:22:33 +0000
committernicm <nicm>2019-12-19 09:22:33 +0000
commit1764f66b7d1ed0e494cfa8967c78ace8728ee86c (patch)
tree84e6483ab9ec00b4f22e61d764b866562ac6e0d8 /key-bindings.c
parentef54a08080ef7d721d05361bf10e27217c87590e (diff)
When adding a list with multiple commands to the queue, the next item to
insert after needs to be the last one added, not the first. Reported by Jason Kim in GitHub issue 2023.
Diffstat (limited to 'key-bindings.c')
-rw-r--r--key-bindings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/key-bindings.c b/key-bindings.c
index d4fada6a..7cd834a2 100644
--- a/key-bindings.c
+++ b/key-bindings.c
@@ -520,8 +520,8 @@ key_bindings_dispatch(struct key_binding *bd, struct cmdq_item *item,
new_item->shared->flags |= CMDQ_SHARED_REPEAT;
}
if (item != NULL)
- cmdq_insert_after(item, new_item);
+ new_item = cmdq_insert_after(item, new_item);
else
- cmdq_append(c, new_item);
+ new_item = cmdq_append(c, new_item);
return (new_item);
}