diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-05-05 16:33:58 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-05-05 16:33:58 +0100 |
commit | c80fc6bf9e44baaad1e6f4a4c83ec47823e96c1b (patch) | |
tree | 71b9bcb1544b58cd13a906f3c558984a0b0867f7 /mode-tree.c | |
parent | 2f89d2e7d816918e152aacfee85fab45ee2057b9 (diff) | |
download | rtmux-c80fc6bf9e44baaad1e6f4a4c83ec47823e96c1b.tar.gz rtmux-c80fc6bf9e44baaad1e6f4a4c83ec47823e96c1b.tar.bz2 rtmux-c80fc6bf9e44baaad1e6f4a4c83ec47823e96c1b.zip |
Add M-+ and M-- to expand and collapse all items in tree mode.
Diffstat (limited to 'mode-tree.c')
-rw-r--r-- | mode-tree.c | 12 |
1 files changed, 11 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 */ |