From 1bf9555e4f1ad19e1e6f97ede6fb19808ff1c267 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 16 Jun 2020 08:18:34 +0000 Subject: d and D keys to reset to default in customize mode. --- mode-tree.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'mode-tree.c') diff --git a/mode-tree.c b/mode-tree.c index 993070ec..c4b776f9 100644 --- a/mode-tree.c +++ b/mode-tree.c @@ -80,7 +80,9 @@ struct mode_tree_item { int expanded; int tagged; + int draw_as_parent; + int no_tag; struct mode_tree_list children; TAILQ_ENTRY(mode_tree_item) entry; @@ -565,6 +567,12 @@ mode_tree_draw_as_parent(struct mode_tree_item *mti) mti->draw_as_parent = 1; } +void +mode_tree_no_tag(struct mode_tree_item *mti) +{ + mti->no_tag = 1; +} + void mode_tree_remove(struct mode_tree_data *mtd, struct mode_tree_item *mti) { @@ -1053,6 +1061,8 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key, * Do not allow parents and children to both be tagged: untag * all parents and children of current. */ + if (current->no_tag) + break; if (!current->tagged) { parent = current->parent; while (parent != NULL) { @@ -1072,7 +1082,10 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key, break; case '\024': /* C-t */ for (i = 0; i < mtd->line_size; i++) { - if (mtd->line_list[i].item->parent == NULL) + if ((mtd->line_list[i].item->parent == NULL && + !mtd->line_list[i].item->no_tag) || + (mtd->line_list[i].item->parent != NULL && + mtd->line_list[i].item->parent->no_tag)) mtd->line_list[i].item->tagged = 1; else mtd->line_list[i].item->tagged = 0; -- cgit