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

@@ -2419,20 +2419,10 @@ format_cb_pane_y(struct format_tree *ft)
static void *
format_cb_pane_z(struct format_tree *ft)
{
struct window_pane *wp;
u_int n = 0;
u_int idx;
if (ft->wp != NULL) {
if (~ft->wp->flags & PANE_FLOATING)
return (xstrdup("0"));
TAILQ_FOREACH(wp, &ft->wp->window->z_index, zentry) {
if (wp->flags & PANE_FLOATING)
n++;
if (wp == ft->wp)
return (format_printf("%u", n));
}
return (xstrdup("0"));
}
if (ft->wp != NULL && window_pane_zindex(ft->wp, &idx) == 0)
return (format_printf("%u", idx));
return (NULL);
}