diff options
Diffstat (limited to 'src/plugins/buflist/buflist-bar-item.c')
-rw-r--r-- | src/plugins/buflist/buflist-bar-item.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/plugins/buflist/buflist-bar-item.c b/src/plugins/buflist/buflist-bar-item.c index 7585bf3c6..e0e12483a 100644 --- a/src/plugins/buflist/buflist-bar-item.c +++ b/src/plugins/buflist/buflist-bar-item.c @@ -105,24 +105,34 @@ buflist_bar_item_get_index_with_pointer (struct t_gui_bar_item *item) /* * Updates buflist bar item if buflist is enabled (or if force argument is 1). * - * If force == 1, all used items are refreshed - * (according to option buflist.look.use_items). + * If index == -1, all bar items (or all bar items used) are refreshed, + * otherwise only this bar item is refreshed. + * + * If force == 1, all used items are refreshed (according to option + * buflist.look.use_items). * If force == 2, all items are refreshed. */ void -buflist_bar_item_update (int force) +buflist_bar_item_update (int index, int force) { int i, num_items; if (force || weechat_config_boolean (buflist_config_look_enabled)) { - num_items = (force == 2) ? - BUFLIST_BAR_NUM_ITEMS : - weechat_config_integer (buflist_config_look_use_items); - for (i = 0; i < num_items; i++) + if ((index >= 0) && (index < BUFLIST_BAR_NUM_ITEMS)) + { + weechat_bar_item_update (buflist_bar_item_get_name (index)); + } + else { - weechat_bar_item_update (buflist_bar_item_get_name (i)); + num_items = (force == 2) ? + BUFLIST_BAR_NUM_ITEMS : + weechat_config_integer (buflist_config_look_use_items); + for (i = 0; i < num_items; i++) + { + weechat_bar_item_update (buflist_bar_item_get_name (i)); + } } } } |