summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--usr.bin/tmux/mode-tree.c4
-rw-r--r--usr.bin/tmux/window-tree.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/tmux/mode-tree.c b/usr.bin/tmux/mode-tree.c
index ccae137bcb8..1bdbb0d2406 100644
--- a/usr.bin/tmux/mode-tree.c
+++ b/usr.bin/tmux/mode-tree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mode-tree.c,v 1.11 2017/09/08 16:28:41 nicm Exp $ */
+/* $OpenBSD: mode-tree.c,v 1.12 2017/10/11 08:08:16 nicm Exp $ */
/*
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -774,11 +774,13 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key,
case KEYC_UP:
case 'k':
case KEYC_WHEELUP_PANE:
+ case '\020': /* C-p */
mode_tree_up(mtd, 1);
break;
case KEYC_DOWN:
case 'j':
case KEYC_WHEELDOWN_PANE:
+ case '\016': /* C-n */
mode_tree_down(mtd, 1);
break;
case KEYC_PPAGE:
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;
}
}