aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authornicm <nicm>2019-03-18 15:25:36 +0000
committernicm <nicm>2019-03-18 15:25:36 +0000
commitd738d5168804405240a3f36b6f410baee39cd9e0 (patch)
treec7459e790d1efb2a82a4078ad2b16af08e7d0399 /window.c
parent2628af573d98f7bdd4db02c7a80c860b867a45fb (diff)
downloadrtmux-d738d5168804405240a3f36b6f410baee39cd9e0.tar.gz
rtmux-d738d5168804405240a3f36b6f410baee39cd9e0.tar.bz2
rtmux-d738d5168804405240a3f36b6f410baee39cd9e0.zip
Mode init needs to be fired with the mode on the list or it will not be
resized correctly.
Diffstat (limited to 'window.c')
-rw-r--r--window.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/window.c b/window.c
index a5c68ece..a74d01d7 100644
--- a/window.c
+++ b/window.c
@@ -1247,16 +1247,17 @@ window_pane_set_mode(struct window_pane *wp, const struct window_mode *mode,
if (wme->mode == mode)
break;
}
- if (wme != NULL)
+ if (wme != NULL) {
TAILQ_REMOVE(&wp->modes, wme, entry);
- else {
+ TAILQ_INSERT_HEAD(&wp->modes, wme, entry);
+ } else {
wme = xcalloc(1, sizeof *wme);
wme->wp = wp;
wme->mode = mode;
wme->prefix = 1;
+ TAILQ_INSERT_HEAD(&wp->modes, wme, entry);
wme->screen = wme->mode->init(wme, fs, args);
}
- TAILQ_INSERT_HEAD(&wp->modes, wme, entry);
wp->screen = wme->screen;
wp->flags |= (PANE_REDRAW|PANE_CHANGED);