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. --- cmd-run-shell.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd-run-shell.c') diff --git a/cmd-run-shell.c b/cmd-run-shell.c index 8e99f90b..c9a478c7 100644 --- a/cmd-run-shell.c +++ b/cmd-run-shell.c @@ -60,6 +60,7 @@ cmd_run_shell_print(struct job *job, const char *msg) struct cmd_run_shell_data *cdata = job_get_data(job); struct window_pane *wp = NULL; struct cmd_find_state fs; + struct window_mode_entry *wme; if (cdata->wp_id != -1) wp = window_pane_find_by_id(cdata->wp_id); @@ -75,10 +76,9 @@ cmd_run_shell_print(struct job *job, const char *msg) return; } - 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_add(wp, "%s", msg); } -- cgit