1
0
mirror of https://github.com/irssi/irssi.git synced 2025-01-03 14:56:47 -05:00

Merge pull request #851 from ailin-nemui/theme-block-tree

unblock theme elements when processing finished
This commit is contained in:
ailin-nemui 2018-02-16 13:57:05 +01:00 committed by GitHub
commit ad4324d242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -413,7 +413,7 @@ static char *theme_format_expand_abstract(THEME_REC *theme, const char **formatp
{
GString *str;
const char *p, *format;
char *abstract, *data, *ret;
char *abstract, *data, *ret, *blocking;
theme_rm_col default_fg, default_bg;
int len;
@ -455,8 +455,10 @@ static char *theme_format_expand_abstract(THEME_REC *theme, const char **formatp
/* unknown abstract, just display the data */
data = "$0-";
g_free(abstract);
blocking = NULL;
} else {
g_tree_insert(block_list, abstract, abstract);
blocking = abstract;
g_tree_insert(block_list, blocking, blocking);
}
abstract = g_strdup(data);
@ -503,6 +505,9 @@ static char *theme_format_expand_abstract(THEME_REC *theme, const char **formatp
ret = theme_format_expand_data_rec(theme, &p, default_fg, default_bg, last_fg, last_bg,
flags | EXPAND_FLAG_LASTCOLOR_ARG, block_list);
g_free(abstract);
if (blocking != NULL) {
g_tree_remove(block_list, blocking);
}
g_tree_unref(block_list);
return ret;
}