diff options
author | 2019-03-12 11:16:49 +0000 | |
---|---|---|
committer | 2019-03-12 11:16:49 +0000 | |
commit | 2c8678f77a1ff1cce3579aa4c6553911c9f4dde2 (patch) | |
tree | a58e089f82315aac5e2eef457bff6c90afac2435 /usr.bin/tmux/server-client.c | |
parent | Almost all terminals now support hardware tabs so default to OXTABS (diff) | |
download | wireguard-openbsd-2c8678f77a1ff1cce3579aa4c6553911c9f4dde2.tar.xz wireguard-openbsd-2c8678f77a1ff1cce3579aa4c6553911c9f4dde2.zip |
Allow multiple modes to be open in a pane. A stack of open modes is kept
and the previous restored when the top is exited. If a mode that is
already on the stack is entered, the existing instance is moved to the
top as the active mode rather than being opened new.
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r-- | usr.bin/tmux/server-client.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 4bce307a4a3..e0fe2081f81 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.266 2019/03/07 20:24:21 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.267 2019/03/12 11:16:50 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -921,18 +921,18 @@ server_client_assume_paste(struct session *s) void server_client_handle_key(struct client *c, key_code key) { - struct mouse_event *m = &c->tty.mouse; - struct session *s = c->session; - struct winlink *wl; - struct window *w; - 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; - key_code key0; + struct mouse_event *m = &c->tty.mouse; + struct session *s = c->session; + struct winlink *wl; + struct window *w; + struct window_pane *wp; + struct window_mode_entry *wme; + struct timeval tv; + struct key_table *table, *first; + struct key_binding *bd; + int xtimeout, flags; + struct cmd_find_state fs; + key_code key0; /* Check the client is good to accept input. */ if (s == NULL || (c->flags & (CLIENT_DEAD|CLIENT_SUSPENDED)) != 0) @@ -1009,11 +1009,9 @@ 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->mode->key_table != NULL) { - tablename = wp->mode->mode->key_table(wp->mode); - table = key_bindings_get_table(tablename, 1); - } + (wme = TAILQ_FIRST(&wp->modes)) != NULL && + wme->mode->key_table != NULL) + table = key_bindings_get_table(wme->mode->key_table(wme), 1); else table = c->keytable; first = table; |