From e77ea9dc26b1238708c841e395eb3544c0519452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 31 Jul 2022 09:58:29 +0200 Subject: buflist: add variable "${hotlist_priority_number}" (integer version of "${hotlist_priority}") --- src/plugins/buflist/buflist-bar-item.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/plugins/buflist/buflist-bar-item.c') diff --git a/src/plugins/buflist/buflist-bar-item.c b/src/plugins/buflist/buflist-bar-item.c index 39aa598d9..82be155aa 100644 --- a/src/plugins/buflist/buflist-bar-item.c +++ b/src/plugins/buflist/buflist-bar-item.c @@ -316,6 +316,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, int item_index, num_buffers, is_channel, is_private; int i, j, length_max_number, current_buffer, number, prev_number, priority; int rc, count, line_number, line_number_current_buffer; + int hotlist_priority_number; /* make C compiler happy */ (void) data; @@ -517,6 +518,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, ptr_hotlist_format = weechat_config_string ( buflist_config_format_hotlist_level_none); ptr_hotlist_priority = hotlist_priority_none; + hotlist_priority_number = -1; if (ptr_hotlist) { priority = weechat_hdata_integer (buflist_hdata_hotlist, @@ -526,12 +528,17 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, ptr_hotlist_format = weechat_config_string ( buflist_config_format_hotlist_level[priority]); ptr_hotlist_priority = hotlist_priority[priority]; + hotlist_priority_number = priority; } } weechat_hashtable_set (buflist_hashtable_extra_vars, "color_hotlist", ptr_hotlist_format); weechat_hashtable_set (buflist_hashtable_extra_vars, "hotlist_priority", ptr_hotlist_priority); + snprintf (str_number, sizeof (str_number), + "%d", hotlist_priority_number); + weechat_hashtable_set (buflist_hashtable_extra_vars, + "hotlist_priority_number", str_number); str_hotlist = NULL; if (ptr_hotlist) { -- cgit v1.2.3