mirror of
https://github.com/tmux/tmux.git
synced 2026-10-09 11:44:23 +00:00
Merge remote-tracking branch 'origin/master' into command_parser
# Conflicts: # cmd-queue.c # notify.c # options.c
This commit is contained in:
19
mode-tree.c
19
mode-tree.c
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD$ */
|
||||
/* $OpenBSD: mode-tree.c,v 1.99 2026/07/06 12:08:52 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -37,8 +37,7 @@ enum mode_tree_preview {
|
||||
};
|
||||
|
||||
#define MODE_TREE_PREFIX_STYLE \
|
||||
"#{?mode_tree_selected,#[default]#[noacs]," \
|
||||
"#[fg=themelightgrey]#[bg=default]#[noacs]}"
|
||||
"#[fg=themelightgrey]#[bg=default]#[noacs]"
|
||||
|
||||
#define MODE_TREE_PREFIX_FORMAT \
|
||||
MODE_TREE_PREFIX_STYLE \
|
||||
@@ -835,6 +834,11 @@ mode_tree_draw(struct mode_tree_data *mtd)
|
||||
if (mtd->line_size == 0)
|
||||
return;
|
||||
|
||||
w = mtd->width;
|
||||
h = mtd->height;
|
||||
if (w == 0 || h == 0)
|
||||
return;
|
||||
|
||||
memcpy(&gc0, &grid_default_cell, sizeof gc0);
|
||||
memcpy(&gc, &grid_default_cell, sizeof gc);
|
||||
style_apply(&gc, oo, "tree-mode-selection-style", NULL);
|
||||
@@ -844,9 +848,6 @@ mode_tree_draw(struct mode_tree_data *mtd)
|
||||
dfg = gc.fg;
|
||||
dfg0 = gc0.fg;
|
||||
|
||||
w = mtd->width;
|
||||
h = mtd->height;
|
||||
|
||||
screen_write_start(&ctx, s);
|
||||
screen_write_clearscreen(&ctx, 8);
|
||||
ft = format_create_defaults(NULL, NULL, NULL, NULL, wp);
|
||||
@@ -950,16 +951,16 @@ mode_tree_draw(struct mode_tree_data *mtd)
|
||||
}
|
||||
} else {
|
||||
screen_write_clearendofline(&ctx, gc.bg);
|
||||
format_draw(&ctx, &gc, prefix_width, prefix, NULL, 0);
|
||||
format_draw(&ctx, &gc, prefix_width, prefix, NULL, 1);
|
||||
if (left != 0) {
|
||||
screen_write_cursormove(&ctx, prefix_width,
|
||||
i - mtd->offset, 0);
|
||||
format_draw(&ctx, &gc, left, text, NULL, 0);
|
||||
format_draw(&ctx, &gc, left, text, NULL, 1);
|
||||
if (mti->text != NULL && width < w) {
|
||||
screen_write_cursormove(&ctx, width,
|
||||
i - mtd->offset, 0);
|
||||
format_draw(&ctx, &gc, w - width,
|
||||
mti->text, NULL, 0);
|
||||
mti->text, NULL, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user