diff options
author | nicm <nicm> | 2020-05-16 15:46:01 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-05-16 15:46:01 +0000 |
commit | 4de0bd4c5c9eec6dd71cac87b91e736944896c22 (patch) | |
tree | 4496655a5204a9ba39d867a6132680664a145f53 | |
parent | cf9baddd6f844e8a26f1e7c59ba1c9eb3358571f (diff) | |
download | rtmux-4de0bd4c5c9eec6dd71cac87b91e736944896c22.tar.gz rtmux-4de0bd4c5c9eec6dd71cac87b91e736944896c22.tar.bz2 rtmux-4de0bd4c5c9eec6dd71cac87b91e736944896c22.zip |
Add M-+ and M-- to expand and collapse all items in tree mode.
-rw-r--r-- | mode-tree.c | 12 | ||||
-rw-r--r-- | tmux.1 | 4 |
2 files changed, 15 insertions, 1 deletions
diff --git a/mode-tree.c b/mode-tree.c index 8d210d72..c08c802d 100644 --- a/mode-tree.c +++ b/mode-tree.c @@ -887,7 +887,7 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key, struct mouse_event *m, u_int *xp, u_int *yp) { struct mode_tree_line *line; - struct mode_tree_item *current, *parent; + struct mode_tree_item *current, *parent, *mti; u_int i, x, y; int choice; key_code tmp; @@ -1058,6 +1058,16 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key, mode_tree_build(mtd); } break; + case '-'|KEYC_ESCAPE: + TAILQ_FOREACH(mti, &mtd->children, entry) + mti->expanded = 0; + mode_tree_build(mtd); + break; + case '+'|KEYC_ESCAPE: + TAILQ_FOREACH(mti, &mtd->children, entry) + mti->expanded = 1; + mode_tree_build(mtd); + break; case '?': case '/': case '\023': /* C-s */ @@ -1903,6 +1903,10 @@ The following keys may be used in tree mode: .It Li "Enter" Ta "Choose selected item" .It Li "Up" Ta "Select previous item" .It Li "Down" Ta "Select next item" +.It Li "+" Ta "Expand selected item" +.It Li "-" Ta "Collapse selected item" +.It Li "M-+" Ta "Expand all items" +.It Li "M--" Ta "Collapse all items" .It Li "x" Ta "Kill selected item" .It Li "X" Ta "Kill tagged items" .It Li "<" Ta "Scroll list of previews left" |