diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-02-24 00:25:03 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-02-24 00:25:03 +0000 |
commit | c5239c59846c2d09725d4b1db0e728b3376c3998 (patch) | |
tree | 1fedf6dcd02ec5c6b18ee45146dc21957d4b8c4e /resize.c | |
parent | be13479f099749b2a199e17505797e51090caca0 (diff) |
Add resize-pane -Z to temporary zoom the active pane to occupy the full window
or unzoom (restored to the normal layout) if it already zoomed, bound to C-b z
by default. The pane is unzoomed on pretty much any excuse whatsoever.
We considered making this a new layout but the requirements are quite different
from layouts so decided it is better as a special case. Each current layout
cell is saved, a temporary one-cell layout generated and all except the active
pane set to NULL.
Prompted by suggestions and scripts from several. Thanks to Aaron Jensen and
Thiago Padilha for testing an earlier version.
Diffstat (limited to 'resize.c')
-rw-r--r-- | resize.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -50,7 +50,7 @@ recalculate_sizes(void) struct window *w; struct window_pane *wp; u_int i, j, ssx, ssy, has, limit; - int flag, has_status; + int flag, has_status, is_zoomed; RB_FOREACH(s, sessions, &sessions) { has_status = options_get_number(&s->options, "status"); @@ -123,12 +123,16 @@ recalculate_sizes(void) if (w->sx == ssx && w->sy == ssy) continue; - log_debug("window size %u,%u (was %u,%u)", ssx, ssy, w->sx, w->sy); + is_zoomed = w->flags & WINDOW_ZOOMED; + if (is_zoomed) + window_unzoom(w); layout_resize(w, ssx, ssy); window_resize(w, ssx, ssy); + if (is_zoomed && window_pane_visible(w->active)) + window_zoom(w->active); /* * If the current pane is now not visible, move to the next |