1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 18:23:13 +02:00

core: add support of full color option name in command /eval and API function string_eval_expression()

This commit is contained in:
Sébastien Helleu
2015-04-26 10:28:59 +02:00
parent 0f333ee630
commit d322389e04
8 changed files with 35 additions and 5 deletions
+3
View File
@@ -325,6 +325,9 @@ eval_replace_vars_cb (void *data, const char *text)
/* 5. color code */
if (strncmp (text, "color:", 6) == 0)
{
ptr_value = gui_color_search_config (text + 6);
if (ptr_value)
return strdup (ptr_value);
ptr_value = gui_color_get_custom (text + 6);
return strdup ((ptr_value) ? ptr_value : "");
}
+3
View File
@@ -22,6 +22,8 @@
#include <regex.h>
struct t_config_option;
/*
* Color from configuration options.
* When changing some colors below:
@@ -173,6 +175,7 @@ extern struct t_weelist *gui_color_list_with_alias;
/* color functions */
extern const char *gui_color_from_option (struct t_config_option *option);
extern const char *gui_color_search_config (const char *color_name);
extern int gui_color_attr_get_flag (char c);
extern void gui_color_attr_build_string (int color, char *str_attr);