summaryrefslogtreecommitdiffstats
path: root/mode-tree.c
diff options
context:
space:
mode:
authornicm <nicm>2020-06-16 08:18:34 +0000
committernicm <nicm>2020-06-16 08:18:34 +0000
commit1bf9555e4f1ad19e1e6f97ede6fb19808ff1c267 (patch)
tree517c3ac9fd211c1294523af5f9e11104ae41edaa /mode-tree.c
parentafe4ea4250073e482c6ec6accfc539f873df6977 (diff)
d and D keys to reset to default in customize mode.
Diffstat (limited to 'mode-tree.c')
-rw-r--r--mode-tree.c15
1 files changed, 14 insertions, 1 deletions
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;
@@ -566,6 +568,12 @@ mode_tree_draw_as_parent(struct mode_tree_item *mti)
}
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)
{
struct mode_tree_item *parent = mti->parent;
@@ -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;