From d47be1f30378d248053118ed3a92e150b1b5a669 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Tue, 21 Jun 2011 16:17:32 +0200 Subject: [PATCH] core: fix bug with option weechat.look.hotlist_count_max when count_max is greater than 1 and priority in hotlist is highlight --- src/gui/gui-bar-item.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c index 6e6264409..3ac089f0f 100644 --- a/src/gui/gui-bar-item.c +++ b/src/gui/gui-bar-item.c @@ -1037,7 +1037,7 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item, { char buf[2048], format[32], *buffer_without_name_displayed; struct t_gui_hotlist *ptr_hotlist; - int numbers_count, names_count, display_name; + int numbers_count, names_count, display_name, count_max; int priority, priority_min, priority_min_displayed, private; /* make C compiler happy */ @@ -1154,7 +1154,17 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item, { private = (ptr_hotlist->count[GUI_HOTLIST_PRIVATE] > 0) ? 1 : 0; priority_min_displayed = ptr_hotlist->priority + 1; - priority_min = ptr_hotlist->priority - CONFIG_INTEGER(config_look_hotlist_count_max) + 1; + count_max = CONFIG_INTEGER(config_look_hotlist_count_max); + if (!private + && (ptr_hotlist->priority == GUI_HOTLIST_HIGHLIGHT) + && (count_max > 1)) + { + priority_min = ptr_hotlist->priority - count_max; + } + else + { + priority_min = ptr_hotlist->priority - count_max + 1; + } if (priority_min < 0) priority_min = 0; for (priority = ptr_hotlist->priority;