summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/window-tree.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2017-10-11 08:08:16 +0000
committernicm <nicm@openbsd.org>2017-10-11 08:08:16 +0000
commit9e3444da4c78f14f1ae9ff226c3e3dae973d7c3c (patch)
tree1d54f78c18881015dcc100da89831a48be2bfa5a /usr.bin/tmux/window-tree.c
parentMove `kq_count' increase/decrease close to the corresponding TAILQ_* (diff)
downloadwireguard-openbsd-9e3444da4c78f14f1ae9ff226c3e3dae973d7c3c.tar.xz
wireguard-openbsd-9e3444da4c78f14f1ae9ff226c3e3dae973d7c3c.zip
Add C-n and C-p keys for tree mode, and choose the right initial line
when no panes.
Diffstat (limited to 'usr.bin/tmux/window-tree.c')
-rw-r--r--usr.bin/tmux/window-tree.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/tmux/window-tree.c b/usr.bin/tmux/window-tree.c
index 03928724683..133c7631c57 100644
--- a/usr.bin/tmux/window-tree.c
+++ b/usr.bin/tmux/window-tree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-tree.c,v 1.17 2017/08/30 10:33:57 nicm Exp $ */
+/* $OpenBSD: window-tree.c,v 1.18 2017/10/11 08:08:16 nicm Exp $ */
/*
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -434,7 +434,10 @@ window_tree_build(void *modedata, u_int sort_type, uint64_t *tag,
*tag = (uint64_t)data->fs.wl;
break;
case WINDOW_TREE_PANE:
- *tag = (uint64_t)data->fs.wp;
+ if (window_count_panes(data->fs.wl->window) == 1)
+ *tag = (uint64_t)data->fs.wl;
+ else
+ *tag = (uint64_t)data->fs.wp;
break;
}
}