diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2017-05-19 07:39:23 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2017-05-19 07:39:23 +0200 |
commit | b522060cef3a5cd00ef35688e58cc397e4cc806b (patch) | |
tree | 57d01fe7bd65dbea65b2d7eb886536a930c38e21 /src/plugins/buflist | |
parent | 138af6e7dd146696de82cb4ce452028e7107c1f0 (diff) | |
download | weechat-b522060cef3a5cd00ef35688e58cc397e4cc806b.zip |
buflist: add variable ${current_buffer} in bar item evaluation
Diffstat (limited to 'src/plugins/buflist')
-rw-r--r-- | src/plugins/buflist/buflist-bar-item.c | 5 | ||||
-rw-r--r-- | src/plugins/buflist/buflist-command.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/buflist/buflist-bar-item.c b/src/plugins/buflist/buflist-bar-item.c index 4f45592de..38c0a21e7 100644 --- a/src/plugins/buflist/buflist-bar-item.c +++ b/src/plugins/buflist/buflist-bar-item.c @@ -168,6 +168,11 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, goto error; } + /* current buffer */ + weechat_hashtable_set (buflist_hashtable_extra_vars, + "current_buffer", + (current_buffer) ? "1" : "0"); + /* buffer number */ number = weechat_hdata_integer (buflist_hdata_buffer, ptr_buffer, "number"); diff --git a/src/plugins/buflist/buflist-command.c b/src/plugins/buflist/buflist-command.c index 6bfef160b..4a599499e 100644 --- a/src/plugins/buflist/buflist-command.c +++ b/src/plugins/buflist/buflist-command.c @@ -99,6 +99,9 @@ buflist_command_init () "buflist.format.buffer; this can be used in option " "buflist.format.buffer_current to just change the background color " "for example\n" + " - ${current_buffer}: a boolean (\"0\" or \"1\"), \"1\" if " + "this is the current buffer; it can be used in a condition: " + "${if:${current_buffer}?...:...}\n" " - ${format_number}: indented number with separator " "(evaluation of option buflist.format.number)\n" " - ${number}: indented number, for example \" 1\" if there " |