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:
@@ -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 : "");
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user