=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/key-bindings.c,v retrieving revision 1.77 retrieving revision 1.78 diff -c -r1.77 -r1.78 *** src/usr.bin/tmux/key-bindings.c 2017/05/07 21:25:59 1.77 --- src/usr.bin/tmux/key-bindings.c 2017/05/10 10:46:59 1.78 *************** *** 1,4 **** ! /* $OpenBSD: key-bindings.c,v 1.77 2017/05/07 21:25:59 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: key-bindings.c,v 1.78 2017/05/10 10:46:59 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 400,410 **** } void ! key_bindings_dispatch(struct key_binding *bd, struct client *c, ! struct mouse_event *m, struct cmd_find_state *fs) { struct cmd *cmd; ! struct cmdq_item *item; int readonly; readonly = 1; --- 400,410 ---- } void ! key_bindings_dispatch(struct key_binding *bd, struct cmdq_item *item, ! struct client *c, struct mouse_event *m, struct cmd_find_state *fs) { struct cmd *cmd; ! struct cmdq_item *new_item; int readonly; readonly = 1; *************** *** 413,423 **** readonly = 0; } if (!readonly && (c->flags & CLIENT_READONLY)) ! cmdq_append(c, cmdq_get_callback(key_bindings_read_only, NULL)); else { ! item = cmdq_get_command(bd->cmdlist, fs, m, 0); if (bd->flags & KEY_BINDING_REPEAT) ! item->shared->flags |= CMDQ_SHARED_REPEAT; ! cmdq_append(c, item); } } --- 413,426 ---- readonly = 0; } if (!readonly && (c->flags & CLIENT_READONLY)) ! new_item = cmdq_get_callback(key_bindings_read_only, NULL); else { ! new_item = cmdq_get_command(bd->cmdlist, fs, m, 0); if (bd->flags & KEY_BINDING_REPEAT) ! new_item->shared->flags |= CMDQ_SHARED_REPEAT; } + if (item != NULL) + cmdq_insert_after(item, new_item); + else + cmdq_append(c, new_item); }