Permalink
Browse files

Add C-n and C-p keys for tree mode, and choose the right initial line

when no panes.
  • Loading branch information...
nicm
nicm committed Oct 11, 2017
1 parent db44151 commit 99351c9cae3c01c68c57aebf127551ec6afe7db2
Showing with 6 additions and 1 deletion.
  1. +2 −0 mode-tree.c
  2. +4 −1 window-tree.c
View
@@ -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:
View
@@ -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;
}
}

0 comments on commit 99351c9

Please sign in to comment.