version 1.12, 2019/07/06 20:37:29 |
version 1.13, 2019/09/15 21:42:57 |
|
|
int focus_start = -1, focus_end = -1; |
int focus_start = -1, focus_end = -1; |
int list_state = -1, fill = -1; |
int list_state = -1, fill = -1; |
enum style_align list_align = STYLE_ALIGN_DEFAULT; |
enum style_align list_align = STYLE_ALIGN_DEFAULT; |
struct grid_cell gc; |
struct grid_cell gc, current_default; |
struct style sy; |
struct style sy, saved_sy; |
struct utf8_data *ud = &sy.gc.data; |
struct utf8_data *ud = &sy.gc.data; |
const char *cp, *end; |
const char *cp, *end; |
enum utf8_state more; |
enum utf8_state more; |
|
|
struct format_ranges frs; |
struct format_ranges frs; |
struct style_range *sr; |
struct style_range *sr; |
|
|
style_set(&sy, base); |
memcpy(¤t_default, base, sizeof current_default); |
|
style_set(&sy, ¤t_default); |
TAILQ_INIT(&frs); |
TAILQ_INIT(&frs); |
log_debug("%s: %s", __func__, expanded); |
log_debug("%s: %s", __func__, expanded); |
|
|
|
|
for (i = 0; i < TOTAL; i++) { |
for (i = 0; i < TOTAL; i++) { |
screen_init(&s[i], size, 1, 0); |
screen_init(&s[i], size, 1, 0); |
screen_write_start(&ctx[i], NULL, &s[i]); |
screen_write_start(&ctx[i], NULL, &s[i]); |
screen_write_clearendofline(&ctx[i], base->bg); |
screen_write_clearendofline(&ctx[i], current_default.bg); |
width[i] = 0; |
width[i] = 0; |
} |
} |
|
|
|
|
goto out; |
goto out; |
} |
} |
tmp = xstrndup(cp + 2, end - (cp + 2)); |
tmp = xstrndup(cp + 2, end - (cp + 2)); |
if (style_parse(&sy, base, tmp) != 0) { |
style_copy(&saved_sy, &sy); |
|
if (style_parse(&sy, ¤t_default, tmp) != 0) { |
log_debug("%s: invalid style '%s'", __func__, tmp); |
log_debug("%s: invalid style '%s'", __func__, tmp); |
free(tmp); |
free(tmp); |
cp = end + 1; |
cp = end + 1; |
|
|
/* If this style has a fill colour, store it for later. */ |
/* If this style has a fill colour, store it for later. */ |
if (sy.fill != 8) |
if (sy.fill != 8) |
fill = sy.fill; |
fill = sy.fill; |
|
|
|
/* If this style pushed or popped the default, update it. */ |
|
if (sy.default_type == STYLE_DEFAULT_PUSH) { |
|
memcpy(¤t_default, &saved_sy.gc, sizeof current_default); |
|
sy.default_type = STYLE_DEFAULT_BASE; |
|
} else if (sy.default_type == STYLE_DEFAULT_POP) { |
|
memcpy(¤t_default, base, sizeof current_default); |
|
sy.default_type = STYLE_DEFAULT_BASE; |
|
} |
|
|
/* Check the list state. */ |
/* Check the list state. */ |
switch (sy.list) { |
switch (sy.list) { |