1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 14:26:39 +02:00

buflist: add variable ${format_name} in bar item evaluation and option buflist.format.name (issue #1020)

This commit is contained in:
Sébastien Helleu
2017-06-23 12:00:34 +02:00
parent 5a9269ba20
commit b3dd47edd8
30 changed files with 241 additions and 342 deletions
+6
View File
@@ -316,8 +316,10 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
ptr_name = weechat_hdata_string (buflist_hdata_buffer,
ptr_buffer, "short_name");
if (!ptr_name)
{
ptr_name = weechat_hdata_string (buflist_hdata_buffer,
ptr_buffer, "name");
}
if (*buflist[0])
{
@@ -440,6 +442,10 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
"indent", ptr_format_indent);
weechat_hashtable_set (buflist_hashtable_extra_vars,
"name", ptr_name);
weechat_hashtable_set (buflist_hashtable_extra_vars,
"format_name",
weechat_config_string (
buflist_config_format_name));
/* hotlist */
ptr_hotlist_format = weechat_config_string (
+2
View File
@@ -120,6 +120,8 @@ buflist_command_init ()
"(set only if the option buflist.look.nick_prefix is enabled)\n"
" - ${nick_prefix}: nick prefix for a channel "
"(set only if the option buflist.look.nick_prefix is enabled)\n"
" - ${format_name}: formatted name (evaluation of option "
"buflist.format.name)\n"
" - ${name}: the short name (if set), with a fallback on the "
"name\n"
" - ${color_hotlist}: the color depending on the highest "
+12 -1
View File
@@ -53,6 +53,7 @@ struct t_config_option *buflist_config_format_hotlist_level_none;
struct t_config_option *buflist_config_format_hotlist_separator;
struct t_config_option *buflist_config_format_indent;
struct t_config_option *buflist_config_format_lag;
struct t_config_option *buflist_config_format_name;
struct t_config_option *buflist_config_format_nick_prefix;
struct t_config_option *buflist_config_format_number;
@@ -463,7 +464,8 @@ buflist_config_init ()
N_("format of each line with a buffer "
"(note: content is evaluated, see /help buflist)"),
NULL, 0, 0,
"${format_number}${indent}${format_nick_prefix}${color_hotlist}${name}",
"${format_number}${indent}${format_nick_prefix}${color_hotlist}"
"${format_name}",
NULL, 0,
NULL, NULL, NULL,
&buflist_config_change_buflist, NULL, NULL,
@@ -562,6 +564,15 @@ buflist_config_init ()
NULL, NULL, NULL,
&buflist_config_change_buflist, NULL, NULL,
NULL, NULL, NULL);
buflist_config_format_name = weechat_config_new_option (
buflist_config_file, ptr_section,
"name", "string",
N_("format for buffer name "
"(note: content is evaluated, see /help buflist)"),
NULL, 0, 0, "${name}", NULL, 0,
NULL, NULL, NULL,
&buflist_config_change_buflist, NULL, NULL,
NULL, NULL, NULL);
buflist_config_format_nick_prefix = weechat_config_new_option (
buflist_config_file, ptr_section,
"nick_prefix", "string",
+1
View File
@@ -51,6 +51,7 @@ extern struct t_config_option *buflist_config_format_hotlist_level_none;
extern struct t_config_option *buflist_config_format_hotlist_separator;
extern struct t_config_option *buflist_config_format_indent;
extern struct t_config_option *buflist_config_format_lag;
extern struct t_config_option *buflist_config_format_name;
extern struct t_config_option *buflist_config_format_nick_prefix;
extern struct t_config_option *buflist_config_format_number;