From 8b84fc177cf2af7fcb68262a016e6c3e19cd8ba5 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 12 Jul 2017 14:31:06 +0000 Subject: [PATCH] Line up keys in tree mode, and don't expand windows with one pane. From Thomas Adam. --- mode-tree.c | 2 +- window-tree.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mode-tree.c b/mode-tree.c index 8ce4c403..536da03b 100644 --- a/mode-tree.c +++ b/mode-tree.c @@ -487,7 +487,7 @@ mode_tree_draw(struct mode_tree_data *mtd) screen_write_cursormove(&ctx, 0, i - mtd->offset); if (i < 10) - snprintf(key, sizeof key, "(%c)", '0' + i); + snprintf(key, sizeof key, "(%c) ", '0' + i); else if (i < 36) snprintf(key, sizeof key, "(M-%c)", 'a' + (i - 10)); else diff --git a/window-tree.c b/window-tree.c index 272e4d0a..82a39821 100644 --- a/window-tree.c +++ b/window-tree.c @@ -258,8 +258,12 @@ window_tree_build_window(struct session *s, struct winlink *wl, void* modedata, free(text); free(name); + if (window_count_panes(wl->window) == 1) + return (1); + l = NULL; n = 0; + TAILQ_FOREACH(wp, &wl->window->panes, entry) { if (filter != NULL) { cp = format_single(NULL, filter, NULL, s, wl, wp);