From 2c8678f77a1ff1cce3579aa4c6553911c9f4dde2 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 12 Mar 2019 11:16:49 +0000 Subject: 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. --- usr.bin/tmux/cmd-queue.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'usr.bin/tmux/cmd-queue.c') diff --git a/usr.bin/tmux/cmd-queue.c b/usr.bin/tmux/cmd-queue.c index 633f0f1433b..84c25b311da 100644 --- a/usr.bin/tmux/cmd-queue.c +++ b/usr.bin/tmux/cmd-queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-queue.c,v 1.60 2019/03/08 10:34:20 nicm Exp $ */ +/* $OpenBSD: cmd-queue.c,v 1.61 2019/03/12 11:16:50 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott @@ -404,10 +404,11 @@ cmdq_guard(struct cmdq_item *item, const char *guard, int flags) void cmdq_print(struct cmdq_item *item, const char *fmt, ...) { - struct client *c = item->client; - struct window_pane *wp; - va_list ap; - char *tmp, *msg; + struct client *c = item->client; + struct window_pane *wp; + struct window_mode_entry *wme; + va_list ap; + char *tmp, *msg; va_start(ap, fmt); @@ -426,10 +427,9 @@ cmdq_print(struct cmdq_item *item, const char *fmt, ...) server_client_push_stdout(c); } else { wp = c->session->curw->window->active; - if (wp->mode == NULL || wp->mode->mode != &window_view_mode) { - window_pane_reset_mode(wp); + wme = TAILQ_FIRST(&wp->modes); + if (wme == NULL || wme->mode != &window_view_mode) window_pane_set_mode(wp, &window_view_mode, NULL, NULL); - } window_copy_vadd(wp, fmt, ap); } -- cgit v1.2.3-59-g8ed1b