=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/layout.c,v retrieving revision 1.39 retrieving revision 1.40 diff -c -r1.39 -r1.40 *** src/usr.bin/tmux/layout.c 2019/04/04 10:25:35 1.39 --- src/usr.bin/tmux/layout.c 2019/04/17 14:37:48 1.40 *************** *** 1,4 **** ! /* $OpenBSD: layout.c,v 1.39 2019/04/04 10:25:35 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: layout.c,v 1.40 2019/04/17 14:37:48 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 831,841 **** */ struct layout_cell * layout_split_pane(struct window_pane *wp, enum layout_type type, int size, ! int insert_before, int full_size) { struct layout_cell *lc, *lcparent, *lcnew, *lc1, *lc2; u_int sx, sy, xoff, yoff, size1, size2; u_int new_size, saved_size, resize_first = 0; /* * If full_size is specified, add a new cell at the top of the window --- 831,842 ---- */ struct layout_cell * layout_split_pane(struct window_pane *wp, enum layout_type type, int size, ! int flags) { struct layout_cell *lc, *lcparent, *lcnew, *lc1, *lc2; u_int sx, sy, xoff, yoff, size1, size2; u_int new_size, saved_size, resize_first = 0; + int full_size = (flags & SPAWN_FULLSIZE); /* * If full_size is specified, add a new cell at the top of the window *************** *** 876,882 **** saved_size = sy; if (size < 0) size2 = ((saved_size + 1) / 2) - 1; ! else if (insert_before) size2 = saved_size - size - 1; else size2 = size; --- 877,883 ---- saved_size = sy; if (size < 0) size2 = ((saved_size + 1) / 2) - 1; ! else if (flags & SPAWN_BEFORE) size2 = saved_size - size - 1; else size2 = size; *************** *** 887,893 **** size1 = saved_size - 1 - size2; /* Which size are we using? */ ! if (insert_before) new_size = size2; else new_size = size1; --- 888,894 ---- size1 = saved_size - 1 - size2; /* Which size are we using? */ ! if (flags & SPAWN_BEFORE) new_size = size2; else new_size = size1; *************** *** 903,909 **** */ lcparent = lc->parent; lcnew = layout_create_cell(lcparent); ! if (insert_before) TAILQ_INSERT_BEFORE(lc, lcnew, entry); else TAILQ_INSERT_AFTER(&lcparent->cells, lc, lcnew, entry); --- 904,910 ---- */ lcparent = lc->parent; lcnew = layout_create_cell(lcparent); ! if (flags & SPAWN_BEFORE) TAILQ_INSERT_BEFORE(lc, lcnew, entry); else TAILQ_INSERT_AFTER(&lcparent->cells, lc, lcnew, entry); *************** *** 932,938 **** layout_set_size(lcnew, size, sy, 0, 0); else if (lc->type == LAYOUT_TOPBOTTOM) layout_set_size(lcnew, sx, size, 0, 0); ! if (insert_before) TAILQ_INSERT_HEAD(&lc->cells, lcnew, entry); else TAILQ_INSERT_TAIL(&lc->cells, lcnew, entry); --- 933,939 ---- layout_set_size(lcnew, size, sy, 0, 0); else if (lc->type == LAYOUT_TOPBOTTOM) layout_set_size(lcnew, sx, size, 0, 0); ! if (flags & SPAWN_BEFORE) TAILQ_INSERT_HEAD(&lc->cells, lcnew, entry); else TAILQ_INSERT_TAIL(&lc->cells, lcnew, entry); *************** *** 956,967 **** /* Create the new child cell. */ lcnew = layout_create_cell(lcparent); ! if (insert_before) TAILQ_INSERT_HEAD(&lcparent->cells, lcnew, entry); else TAILQ_INSERT_TAIL(&lcparent->cells, lcnew, entry); } ! if (insert_before) { lc1 = lcnew; lc2 = lc; } else { --- 957,968 ---- /* Create the new child cell. */ lcnew = layout_create_cell(lcparent); ! if (flags & SPAWN_BEFORE) TAILQ_INSERT_HEAD(&lcparent->cells, lcnew, entry); else TAILQ_INSERT_TAIL(&lcparent->cells, lcnew, entry); } ! if (flags & SPAWN_BEFORE) { lc1 = lcnew; lc2 = lc; } else {