buflist: add variable ${merged} in bar item evaluation
parent
fbf7156b1b
commit
92a40052af
|
@ -31,7 +31,7 @@ Improvements::
|
|||
* core: allow index for hdata arrays in evaluation of expressions
|
||||
* buflist: display a warning when the script "buffers.pl" is loaded
|
||||
* buflist: add support of char "~" in option buflist.look.sort for case insensitive comparison
|
||||
* buflist: add variable `${current_buffer}` (boolean "0" / "1") in bar item evaluation
|
||||
* buflist: add variables `${current_buffer}` and `${merged}` (booleans "0" / "1") in bar item evaluation
|
||||
* relay: add option "start" in command /relay
|
||||
* trigger: add "irc_server" and "irc_channel" pointers in data for IRC signal/modifier hooks
|
||||
|
||||
|
|
|
@ -216,6 +216,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
|
|||
{
|
||||
struct t_arraylist *buffers;
|
||||
struct t_gui_buffer *ptr_buffer, *ptr_current_buffer;
|
||||
struct t_gui_buffer *ptr_buffer_prev, *ptr_buffer_next;
|
||||
struct t_gui_nick *ptr_gui_nick;
|
||||
struct t_gui_hotlist *ptr_hotlist;
|
||||
void *ptr_server, *ptr_channel;
|
||||
|
@ -350,6 +351,29 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data,
|
|||
}
|
||||
prev_number = number;
|
||||
|
||||
/* buffer merged */
|
||||
ptr_buffer_prev = weechat_hdata_move (buflist_hdata_buffer,
|
||||
ptr_buffer, -1);
|
||||
ptr_buffer_next = weechat_hdata_move (buflist_hdata_buffer,
|
||||
ptr_buffer, 1);
|
||||
if ((ptr_buffer_prev
|
||||
&& (weechat_hdata_integer (buflist_hdata_buffer,
|
||||
ptr_buffer_prev,
|
||||
"number") == number))
|
||||
|| (ptr_buffer_next
|
||||
&& (weechat_hdata_integer (buflist_hdata_buffer,
|
||||
ptr_buffer_next,
|
||||
"number") == number)))
|
||||
{
|
||||
weechat_hashtable_set (buflist_hashtable_extra_vars,
|
||||
"merged", "1");
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_hashtable_set (buflist_hashtable_extra_vars,
|
||||
"merged", "0");
|
||||
}
|
||||
|
||||
/* buffer name */
|
||||
ptr_type = weechat_buffer_get_string (ptr_buffer, "localvar_type");
|
||||
is_channel = (ptr_type && (strcmp (ptr_type, "channel") == 0));
|
||||
|
|
Loading…
Reference in New Issue