summaryrefslogtreecommitdiffstats
path: root/key-bindings.c
diff options
context:
space:
mode:
authornicm <nicm>2020-04-13 08:26:27 +0000
committernicm <nicm>2020-04-13 08:26:27 +0000
commitc20eb0c0ae3347c768894a6355adfd7ebae6f2f3 (patch)
tree970e82f29bd603d459476d44245ce73aad18666e /key-bindings.c
parent9cbe9675ea8a8efb01dcc5f267e6d5853b2cd58f (diff)
Make struct cmd local to cmd.c and move it out of tmux.h.
Diffstat (limited to 'key-bindings.c')
-rw-r--r--key-bindings.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/key-bindings.c b/key-bindings.c
index 3c6f8ff6..b76589ce 100644
--- a/key-bindings.c
+++ b/key-bindings.c
@@ -537,19 +537,13 @@ struct cmdq_item *
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;
if (c == NULL || (~c->flags & CLIENT_READONLY))
readonly = 1;
- else {
- readonly = 1;
- TAILQ_FOREACH(cmd, &bd->cmdlist->list, qentry) {
- if (~cmd->entry->flags & CMD_READONLY)
- readonly = 0;
- }
- }
+ else
+ readonly = cmd_list_all_have(bd->cmdlist, CMD_READONLY);
if (!readonly)
new_item = cmdq_get_callback(key_bindings_read_only, NULL);
else {