Add top-floating and bottom-floating to pane-border-status to show

status line only on floating panes.
This commit is contained in:
nicm
2026-06-15 08:16:05 +00:00
parent 97b5f22a70
commit 7a18fa281d
7 changed files with 65 additions and 32 deletions

View File

@@ -2126,16 +2126,14 @@ struct style_range *
window_pane_status_get_range(struct window_pane *wp, u_int x, u_int y)
{
struct style_ranges *srs;
struct window *w;
u_int line;
int pane_status;
if (wp == NULL)
return (NULL);
w = wp->window;
srs = &wp->border_status_line.ranges;
pane_status = window_get_pane_status(w);
pane_status = window_pane_get_pane_status(wp);
if (pane_status == PANE_STATUS_TOP)
line = wp->yoff - 1;
else if (pane_status == PANE_STATUS_BOTTOM)
@@ -2153,7 +2151,29 @@ window_pane_status_get_range(struct window_pane *wp, u_int x, u_int y)
int
window_get_pane_status(struct window *w)
{
return (options_get_number(w->options, "pane-border-status"));
int status;
status = options_get_number(w->options, "pane-border-status");
if (status == PANE_STATUS_TOP_FLOATING ||
status == PANE_STATUS_BOTTOM_FLOATING)
return (PANE_STATUS_OFF);
return (status);
}
int
window_pane_get_pane_status(struct window_pane *wp)
{
int status;
if (!window_pane_is_floating(wp))
return (window_get_pane_status(wp->window));
status = options_get_number(wp->options, "pane-border-status");
if (status == PANE_STATUS_TOP_FLOATING)
return (PANE_STATUS_TOP);
if (status == PANE_STATUS_BOTTOM_FLOATING)
return (PANE_STATUS_BOTTOM);
return (status);
}
int