1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 01:03:14 +02:00

buflist: add option "buflist.format.lag" and variable "format_lag" for buffer line format

This commit is contained in:
Sébastien Helleu
2017-03-18 15:19:29 +01:00
parent 1963191700
commit 7f69f88468
3 changed files with 26 additions and 0 deletions
+14
View File
@@ -57,6 +57,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
const char *hotlist_priority_none = "none";
const char *hotlist_priority[4] = { "low", "message", "private",
"highlight" };
const char *ptr_lag;
int i, length_max_number, current_buffer, number, prev_number, priority;
int rc;
@@ -166,6 +167,19 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
"color_hotlist", ptr_hotlist_format);
weechat_hashtable_set (buflist_hashtable_extra_vars,
"hotlist_priority", ptr_hotlist_priority);
ptr_lag = weechat_buffer_get_string (ptr_buffer, "localvar_lag");
if (ptr_lag && ptr_lag[0])
{
weechat_hashtable_set (
buflist_hashtable_extra_vars,
"format_lag",
weechat_config_string (buflist_config_format_lag));
}
else
{
weechat_hashtable_set (buflist_hashtable_extra_vars,
"format_lag", "");
}
/* build string */
line = weechat_string_eval_expression (
+11
View File
@@ -39,6 +39,7 @@ struct t_config_option *buflist_config_format_buffer;
struct t_config_option *buflist_config_format_buffer_current;
struct t_config_option *buflist_config_format_hotlist[4];
struct t_config_option *buflist_config_format_hotlist_none;
struct t_config_option *buflist_config_format_lag;
char **buflist_config_sort_fields = NULL;
int buflist_config_sort_fields_count = 0;
@@ -212,6 +213,16 @@ buflist_config_init ()
NULL, NULL, NULL,
&buflist_config_change_buflist, NULL, NULL,
NULL, NULL, NULL);
buflist_config_format_lag = weechat_config_new_option (
buflist_config_file, ptr_section,
"lag", "string",
N_("format for lag on an irc server buffer"),
NULL, 0, 0,
" ${color:green}[${color:brown}${lag}${color:green}]",
NULL, 0,
NULL, NULL, NULL,
&buflist_config_change_buflist, NULL, NULL,
NULL, NULL, NULL);
return 1;
}
+1
View File
@@ -28,6 +28,7 @@ extern struct t_config_option *buflist_config_format_buffer;
extern struct t_config_option *buflist_config_format_buffer_current;
extern struct t_config_option *buflist_config_format_hotlist[4];
extern struct t_config_option *buflist_config_format_hotlist_none;
extern struct t_config_option *buflist_config_format_lag;
extern char **buflist_config_sort_fields;
extern int buflist_config_sort_fields_count;