Add a Z sort order in tree mode.

This commit is contained in:
nicm
2026-06-01 18:19:51 +00:00
parent cd6c01e42b
commit f6557d1ea2
6 changed files with 44 additions and 16 deletions

View File

@@ -880,8 +880,8 @@ window_pane_previous_by_number(struct window *w, struct window_pane *wp,
int
window_pane_index(struct window_pane *wp, u_int *i)
{
struct window_pane *wq;
struct window *w = wp->window;
struct window_pane *wq;
*i = options_get_number(w->options, "pane-base-index");
TAILQ_FOREACH(wq, &w->panes, entry) {
@@ -894,6 +894,26 @@ window_pane_index(struct window_pane *wp, u_int *i)
return (-1);
}
int
window_pane_zindex(struct window_pane *wp, u_int *i)
{
struct window *w = wp->window;
struct window_pane *wq;
*i = 0;
TAILQ_FOREACH(wq, &w->z_index, zentry) {
if (wq == wp) {
if (~wp->flags & PANE_FLOATING)
(*i)++;
return (0);
}
if (wq->flags & PANE_FLOATING)
(*i)++;
}
return (-1);
}
u_int
window_count_panes(struct window *w, int with_floating)
{