From 3f6bfbaf2babcc7f08f628a82ff31b0b52014e58 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. --- input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'input.c') diff --git a/input.c b/input.c index c498bc50..049b82e1 100644 --- a/input.c +++ b/input.c @@ -805,7 +805,7 @@ input_reset(struct window_pane *wp, int clear) input_reset_cell(ictx); if (clear) { - if (wp->mode == NULL) + if (TAILQ_EMPTY(&wp->modes)) screen_write_start(&ictx->ctx, wp, &wp->base); else screen_write_start(&ictx->ctx, NULL, &wp->base); @@ -861,7 +861,7 @@ input_parse(struct window_pane *wp) * Open the screen. Use NULL wp if there is a mode set as don't want to * update the tty. */ - if (wp->mode == NULL) + if (TAILQ_EMPTY(&wp->modes)) screen_write_start(&ictx->ctx, wp, &wp->base); else screen_write_start(&ictx->ctx, NULL, &wp->base); -- cgit v1.2.3