summaryrefslogtreecommitdiffstats
path: root/cmd-queue.c
diff options
context:
space:
mode:
authornicm <nicm>2019-03-12 11:16:49 +0000
committernicm <nicm>2019-03-12 11:16:49 +0000
commit3f6bfbaf2babcc7f08f628a82ff31b0b52014e58 (patch)
treece4bf0c954cdfede0c2e86905bd85a9f565ed370 /cmd-queue.c
parentff4c80d53df96bb46eaa64107673e42d402f0d49 (diff)
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 'cmd-queue.c')
-rw-r--r--cmd-queue.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/cmd-queue.c b/cmd-queue.c
index 2a95a3e5..97b3c1c9 100644
--- a/cmd-queue.c
+++ b/cmd-queue.c
@@ -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);
}