mirror of
https://github.com/tmux/tmux.git
synced 2025-09-07 10:27:00 +00:00
Include key bindings in customize mode.
This commit is contained in:
24
mode-tree.c
24
mode-tree.c
@ -80,6 +80,7 @@ struct mode_tree_item {
|
||||
|
||||
int expanded;
|
||||
int tagged;
|
||||
int draw_as_parent;
|
||||
|
||||
struct mode_tree_list children;
|
||||
TAILQ_ENTRY(mode_tree_item) entry;
|
||||
@ -248,6 +249,12 @@ mode_tree_get_current(struct mode_tree_data *mtd)
|
||||
return (mtd->line_list[mtd->current].item->itemdata);
|
||||
}
|
||||
|
||||
const char *
|
||||
mode_tree_get_current_name(struct mode_tree_data *mtd)
|
||||
{
|
||||
return (mtd->line_list[mtd->current].item->name);
|
||||
}
|
||||
|
||||
void
|
||||
mode_tree_expand_current(struct mode_tree_data *mtd)
|
||||
{
|
||||
@ -257,6 +264,15 @@ mode_tree_expand_current(struct mode_tree_data *mtd)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
mode_tree_collapse_current(struct mode_tree_data *mtd)
|
||||
{
|
||||
if (mtd->line_list[mtd->current].item->expanded) {
|
||||
mtd->line_list[mtd->current].item->expanded = 0;
|
||||
mode_tree_build(mtd);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
mode_tree_get_tag(struct mode_tree_data *mtd, uint64_t tag, u_int *found)
|
||||
{
|
||||
@ -543,6 +559,12 @@ mode_tree_add(struct mode_tree_data *mtd, struct mode_tree_item *parent,
|
||||
return (mti);
|
||||
}
|
||||
|
||||
void
|
||||
mode_tree_draw_as_parent(struct mode_tree_item *mti)
|
||||
{
|
||||
mti->draw_as_parent = 1;
|
||||
}
|
||||
|
||||
void
|
||||
mode_tree_remove(struct mode_tree_data *mtd, struct mode_tree_item *mti)
|
||||
{
|
||||
@ -683,6 +705,8 @@ mode_tree_draw(struct mode_tree_data *mtd)
|
||||
|
||||
line = &mtd->line_list[mtd->current];
|
||||
mti = line->item;
|
||||
if (mti->draw_as_parent)
|
||||
mti = mti->parent;
|
||||
|
||||
screen_write_cursormove(&ctx, 0, h, 0);
|
||||
screen_write_box(&ctx, w, sy - h);
|
||||
|
Reference in New Issue
Block a user