mirror of
https://github.com/tmux/tmux.git
synced 2026-10-10 20:24:21 +00:00
Fix scrollbar with a format colour.
This commit is contained in:
13
style.c
13
style.c
@@ -480,18 +480,25 @@ style_set_scrollbar_style_from_option(struct style *sb_style,
|
|||||||
const struct options_table_entry *oe;
|
const struct options_table_entry *oe;
|
||||||
struct options_entry *o;
|
struct options_entry *o;
|
||||||
const char *s;
|
const char *s;
|
||||||
|
char *style, *expanded;
|
||||||
|
|
||||||
style_set(sb_style, &grid_default_cell);
|
style_set(sb_style, &grid_default_cell);
|
||||||
o = options_get(oo, "pane-scrollbars-style");
|
o = options_get(oo, "pane-scrollbars-style");
|
||||||
if (o == NULL)
|
if (o == NULL)
|
||||||
fatalx("missing pane-scrollbars-style");
|
fatalx("missing pane-scrollbars-style");
|
||||||
oe = options_table_entry(o);
|
oe = options_table_entry(o);
|
||||||
if (style_parse(sb_style, &grid_default_cell, oe->default_str) != 0)
|
style = format_single(NULL, oe->default_str, NULL, NULL, NULL, NULL);
|
||||||
|
if (style_parse(sb_style, &grid_default_cell, style) != 0)
|
||||||
fatalx("bad pane-scrollbars-style default");
|
fatalx("bad pane-scrollbars-style default");
|
||||||
|
|
||||||
s = options_get_string(oo, "pane-scrollbars-style");
|
s = options_get_string(oo, "pane-scrollbars-style");
|
||||||
if (s != NULL && style_parse(sb_style, &grid_default_cell, s) != 0)
|
if (s != NULL) {
|
||||||
style_parse(sb_style, &grid_default_cell, oe->default_str);
|
expanded = format_single(NULL, s, NULL, NULL, NULL, NULL);
|
||||||
|
if (style_parse(sb_style, &grid_default_cell, expanded) != 0)
|
||||||
|
style_parse(sb_style, &grid_default_cell, style);
|
||||||
|
free(expanded);
|
||||||
|
}
|
||||||
|
free(style);
|
||||||
if (sb_style->width < 1)
|
if (sb_style->width < 1)
|
||||||
sb_style->width = PANE_SCROLLBARS_DEFAULT_WIDTH;
|
sb_style->width = PANE_SCROLLBARS_DEFAULT_WIDTH;
|
||||||
if (sb_style->pad < 0)
|
if (sb_style->pad < 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user