summaryrefslogtreecommitdiffstats
path: root/cfg.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 /cfg.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 'cfg.c')
-rw-r--r--cfg.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/cfg.c b/cfg.c
index fc7e345c..d8ce40d3 100644
--- a/cfg.c
+++ b/cfg.c
@@ -341,17 +341,17 @@ cfg_print_causes(struct cmdq_item *item)
void
cfg_show_causes(struct session *s)
{
- struct window_pane *wp;
- u_int i;
+ struct window_pane *wp;
+ struct window_mode_entry *wme;
+ u_int i;
if (s == NULL || cfg_ncauses == 0)
return;
wp = s->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);
- }
for (i = 0; i < cfg_ncauses; i++) {
window_copy_add(wp, "%s", cfg_causes[i]);
free(cfg_causes[i]);