summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cfg.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-03-12 11:16:51 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-03-12 11:16:51 +0000
commitc456969731f70c3030cafcfcd4a67fc5aa1cd36c (patch)
treefc1ae91d94379b8a09eecfb31ee3be5e7c6f59df /usr.bin/tmux/cfg.c
parentbf3b2b3954f062c42cec536e1c766d1d41097483 (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 'usr.bin/tmux/cfg.c')
-rw-r--r--usr.bin/tmux/cfg.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/tmux/cfg.c b/usr.bin/tmux/cfg.c
index 2535a464066..3d2d3b40bc0 100644
--- a/usr.bin/tmux/cfg.c
+++ b/usr.bin/tmux/cfg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cfg.c,v 1.65 2019/03/08 10:34:20 nicm Exp $ */
+/* $OpenBSD: cfg.c,v 1.66 2019/03/12 11:16:49 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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]);