diff options
author | 2019-06-26 13:03:47 +0000 | |
---|---|---|
committer | 2019-06-26 13:03:47 +0000 | |
commit | c1cd4700a4ca63ea3831f8c5747f43cd193c2bd7 (patch) | |
tree | ee47820a180206d434cd78e857ff62029eda5e5e /usr.bin/tmux/layout.c | |
parent | Add support for OCSP stapling (diff) | |
download | wireguard-openbsd-c1cd4700a4ca63ea3831f8c5747f43cd193c2bd7.tar.xz wireguard-openbsd-c1cd4700a4ca63ea3831f8c5747f43cd193c2bd7.zip |
Add #define for the pane status line option position numbers.
Diffstat (limited to 'usr.bin/tmux/layout.c')
-rw-r--r-- | usr.bin/tmux/layout.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/usr.bin/tmux/layout.c b/usr.bin/tmux/layout.c index c36f9641c83..0a23653e979 100644 --- a/usr.bin/tmux/layout.c +++ b/usr.bin/tmux/layout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: layout.c,v 1.43 2019/04/23 09:15:24 nicm Exp $ */ +/* $OpenBSD: layout.c,v 1.44 2019/06/26 13:03:47 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -232,20 +232,20 @@ layout_fix_offsets(struct layout_cell *lc) * case for the most upper panes only. */ static int -layout_need_status(struct layout_cell *lc, int at_top) +layout_need_status(struct layout_cell *lc, int status) { - struct layout_cell *first_lc; + struct layout_cell *next; if (lc->parent != NULL) { if (lc->parent->type == LAYOUT_LEFTRIGHT) - return (layout_need_status(lc->parent, at_top)); + return (layout_need_status(lc->parent, status)); - if (at_top) - first_lc = TAILQ_FIRST(&lc->parent->cells); + if (status == PANE_STATUS_TOP) + next = TAILQ_FIRST(&lc->parent->cells); else - first_lc = TAILQ_LAST(&lc->parent->cells,layout_cells); - if (lc == first_lc) - return (layout_need_status(lc->parent, at_top)); + next = TAILQ_LAST(&lc->parent->cells,layout_cells); + if (lc == next) + return (layout_need_status(lc->parent, status)); return (0); } return (1); @@ -264,8 +264,8 @@ layout_fix_panes(struct window *w) if ((lc = wp->layout_cell) == NULL) continue; - if (status != 0) - shift = layout_need_status(lc, status == 1); + if (status != PANE_STATUS_OFF) + shift = layout_need_status(lc, status); else shift = 0; @@ -317,8 +317,8 @@ layout_resize_check(struct window *w, struct layout_cell *lc, available = lc->sx; else { available = lc->sy; - if (status != 0) - minimum += layout_need_status(lc, status == 1); + if (status != PANE_STATUS_OFF) + minimum += layout_need_status(lc, status); } if (available > minimum) available -= minimum; @@ -862,8 +862,8 @@ layout_split_pane(struct window_pane *wp, enum layout_type type, int size, break; case LAYOUT_TOPBOTTOM: minimum = PANE_MINIMUM * 2 + 1; - if (status != 0) - minimum += layout_need_status(lc, status == 1); + if (status != PANE_STATUS_OFF) + minimum += layout_need_status(lc, status); if (sy < minimum) return (NULL); break; @@ -1030,8 +1030,8 @@ layout_spread_cell(struct window *w, struct layout_cell *parent) size = parent->sx; else if (parent->type == LAYOUT_TOPBOTTOM) { size = parent->sy; - if (status != 0) - size -= layout_need_status(parent, status == 1); + if (status != PANE_STATUS_OFF) + size -= layout_need_status(parent, status); } else return (0); if (size < number - 1) @@ -1050,8 +1050,8 @@ layout_spread_cell(struct window *w, struct layout_cell *parent) layout_resize_adjust(w, lc, LAYOUT_LEFTRIGHT, change); } else if (parent->type == LAYOUT_TOPBOTTOM) { this = each; - if (status != 0) - this += layout_need_status(lc, status == 1); + if (status != PANE_STATUS_OFF) + this += layout_need_status(lc, status); change = this - (int)lc->sy; layout_resize_adjust(w, lc, LAYOUT_TOPBOTTOM, change); } |