mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Add split-window -Z to start the pane zoomed, GitHub issue 2591.
This commit is contained in:
22
layout.c
22
layout.c
@ -286,7 +286,7 @@ layout_add_border(struct window *w, struct layout_cell *lc, int status)
|
||||
|
||||
/* Update pane offsets and sizes based on their cells. */
|
||||
void
|
||||
layout_fix_panes(struct window *w)
|
||||
layout_fix_panes(struct window *w, struct window_pane *skip)
|
||||
{
|
||||
struct window_pane *wp;
|
||||
struct layout_cell *lc;
|
||||
@ -294,7 +294,7 @@ layout_fix_panes(struct window *w)
|
||||
|
||||
status = options_get_number(w->options, "pane-border-status");
|
||||
TAILQ_FOREACH(wp, &w->panes, entry) {
|
||||
if ((lc = wp->layout_cell) == NULL)
|
||||
if ((lc = wp->layout_cell) == NULL || wp == skip)
|
||||
continue;
|
||||
|
||||
wp->xoff = lc->xoff;
|
||||
@ -482,7 +482,7 @@ layout_init(struct window *w, struct window_pane *wp)
|
||||
lc = w->layout_root = layout_create_cell(NULL);
|
||||
layout_set_size(lc, w->sx, w->sy, 0, 0);
|
||||
layout_make_leaf(lc, wp);
|
||||
layout_fix_panes(w);
|
||||
layout_fix_panes(w, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
@ -540,7 +540,7 @@ layout_resize(struct window *w, u_int sx, u_int sy)
|
||||
|
||||
/* Fix cell offsets. */
|
||||
layout_fix_offsets(w);
|
||||
layout_fix_panes(w);
|
||||
layout_fix_panes(w, NULL);
|
||||
}
|
||||
|
||||
/* Resize a pane to an absolute size. */
|
||||
@ -600,7 +600,7 @@ layout_resize_layout(struct window *w, struct layout_cell *lc,
|
||||
|
||||
/* Fix cell offsets. */
|
||||
layout_fix_offsets(w);
|
||||
layout_fix_panes(w);
|
||||
layout_fix_panes(w, NULL);
|
||||
notify_window("window-layout-changed", w);
|
||||
}
|
||||
|
||||
@ -704,10 +704,14 @@ layout_resize_pane_shrink(struct window *w, struct layout_cell *lc,
|
||||
|
||||
/* Assign window pane to newly split cell. */
|
||||
void
|
||||
layout_assign_pane(struct layout_cell *lc, struct window_pane *wp)
|
||||
layout_assign_pane(struct layout_cell *lc, struct window_pane *wp,
|
||||
int do_not_resize)
|
||||
{
|
||||
layout_make_leaf(lc, wp);
|
||||
layout_fix_panes(wp->window);
|
||||
if (do_not_resize)
|
||||
layout_fix_panes(wp->window, wp);
|
||||
else
|
||||
layout_fix_panes(wp->window, NULL);
|
||||
}
|
||||
|
||||
/* Calculate the new pane size for resized parent. */
|
||||
@ -1040,7 +1044,7 @@ layout_close_pane(struct window_pane *wp)
|
||||
/* Fix pane offsets and sizes. */
|
||||
if (w->layout_root != NULL) {
|
||||
layout_fix_offsets(w);
|
||||
layout_fix_panes(w);
|
||||
layout_fix_panes(w, NULL);
|
||||
}
|
||||
notify_window("window-layout-changed", w);
|
||||
}
|
||||
@ -1109,7 +1113,7 @@ layout_spread_out(struct window_pane *wp)
|
||||
do {
|
||||
if (layout_spread_cell(w, parent)) {
|
||||
layout_fix_offsets(w);
|
||||
layout_fix_panes(w);
|
||||
layout_fix_panes(w, NULL);
|
||||
break;
|
||||
}
|
||||
} while ((parent = parent->parent) != NULL);
|
||||
|
Reference in New Issue
Block a user