From f98c66ece81953c777cd332c6bd29d707b1685e5 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 7 Mar 2019 20:24:21 +0000 Subject: Add a separate mode struct for the active window mode if any. --- server-client.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'server-client.c') diff --git a/server-client.c b/server-client.c index bf69a981..a311376c 100644 --- a/server-client.c +++ b/server-client.c @@ -928,6 +928,7 @@ server_client_handle_key(struct client *c, key_code key) struct window_pane *wp; struct timeval tv; struct key_table *table, *first; + const char *tablename; struct key_binding *bd; int xtimeout, flags; struct cmd_find_state fs; @@ -1009,8 +1010,10 @@ server_client_handle_key(struct client *c, key_code key) if (server_client_is_default_key_table(c, c->keytable) && wp != NULL && wp->mode != NULL && - wp->mode->key_table != NULL) - table = key_bindings_get_table(wp->mode->key_table(wp), 1); + wp->mode->mode->key_table != NULL) { + tablename = wp->mode->mode->key_table(wp->mode); + table = key_bindings_get_table(tablename, 1); + } else table = c->keytable; first = table; -- cgit