Add new option weechat.look.hotlist_unique_numbers (task #10691)

This commit is contained in:
Sebastien Helleu 2010-10-12 18:22:11 +02:00
parent 6e695ebe65
commit 0e68117b37
17 changed files with 157 additions and 38 deletions

View File

@ -7,6 +7,7 @@ v0.3.4-dev, 2010-10-12
Version 0.3.4 (under dev!) Version 0.3.4 (under dev!)
-------------------------- --------------------------
* core: add new option weechat.look.hotlist_unique_numbers (task #10691)
* core: add property "no_highlight_nicks" in buffers to disable highlight * core: add property "no_highlight_nicks" in buffers to disable highlight
for some nicks in buffer for some nicks in buffer
* core: add new options weechat.look.input_share and * core: add new options weechat.look.input_share and

View File

@ -423,6 +423,11 @@
** Typ: integer ** Typ: integer
** Werte: group_time_asc, group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc (Standardwert: `group_time_asc`) ** Werte: group_time_asc, group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc (Standardwert: `group_time_asc`)
* *weechat.look.hotlist_unique_numbers*
** Beschreibung: `keep only unique numbers in hotlist (this applies only on hotlist items where name is NOT displayed after number)`
** Typ: boolesch
** Werte: on, off (Standardwert: `on`)
* *weechat.look.input_share* * *weechat.look.input_share*
** Beschreibung: `share commands, text, or both in input for all buffers (there is still local history for each buffer)` ** Beschreibung: `share commands, text, or both in input for all buffers (there is still local history for each buffer)`
** Typ: integer ** Typ: integer

View File

@ -423,6 +423,11 @@
** type: integer ** type: integer
** values: group_time_asc, group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc (default value: `group_time_asc`) ** values: group_time_asc, group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc (default value: `group_time_asc`)
* *weechat.look.hotlist_unique_numbers*
** description: `keep only unique numbers in hotlist (this applies only on hotlist items where name is NOT displayed after number)`
** type: boolean
** values: on, off (default value: `on`)
* *weechat.look.input_share* * *weechat.look.input_share*
** description: `share commands, text, or both in input for all buffers (there is still local history for each buffer)` ** description: `share commands, text, or both in input for all buffers (there is still local history for each buffer)`
** type: integer ** type: integer

View File

@ -414,7 +414,7 @@
** valeurs: on, off (valeur par défaut: `off`) ** valeurs: on, off (valeur par défaut: `off`)
* *weechat.look.hotlist_short_names* * *weechat.look.hotlist_short_names*
** description: `si défini, utilie des noms courts pour afficher les noms de tampons dans la hotlist (commence après le premier '.' dans le nom)` ** description: `si défini, utilise des noms courts pour afficher les noms de tampons dans la hotlist (commence après le premier '.' dans le nom)`
** type: booléen ** type: booléen
** valeurs: on, off (valeur par défaut: `on`) ** valeurs: on, off (valeur par défaut: `on`)
@ -423,6 +423,11 @@
** type: entier ** type: entier
** valeurs: group_time_asc, group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc (valeur par défaut: `group_time_asc`) ** valeurs: group_time_asc, group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc (valeur par défaut: `group_time_asc`)
* *weechat.look.hotlist_unique_numbers*
** description: `garde seulement des numéros uniques dans la hotlist (cela s'applique seulement aux éléments de la hotlist où le nom n'est PAS affiché après le numéro)`
** type: booléen
** valeurs: on, off (valeur par défaut: `on`)
* *weechat.look.input_share* * *weechat.look.input_share*
** description: `partage les commandes, le texte, ou les deux dans la zone de saisie pour tous les tampons (il y a toujours un historique local sur chaque tampon)` ** description: `partage les commandes, le texte, ou les deux dans la zone de saisie pour tous les tampons (il y a toujours un historique local sur chaque tampon)`
** type: entier ** type: entier

View File

@ -423,6 +423,11 @@
** tipo: intero ** tipo: intero
** valori: group_time_asc, group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc (valore predefinito: `group_time_asc`) ** valori: group_time_asc, group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc (valore predefinito: `group_time_asc`)
* *weechat.look.hotlist_unique_numbers*
** descrizione: `keep only unique numbers in hotlist (this applies only on hotlist items where name is NOT displayed after number)`
** tipo: bool
** valori: on, off (valore predefinito: `on`)
* *weechat.look.input_share* * *weechat.look.input_share*
** descrizione: `share commands, text, or both in input for all buffers (there is still local history for each buffer)` ** descrizione: `share commands, text, or both in input for all buffers (there is still local history for each buffer)`
** tipo: intero ** tipo: intero

View File

@ -20,7 +20,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n" "Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-10-12 08:24+0200\n" "POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n" "PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1810,6 +1810,14 @@ msgstr ""
"[skupina_číslo_vzestupně], group_number_desc [skupina_číslo_sestupně], " "[skupina_číslo_vzestupně], group_number_desc [skupina_číslo_sestupně], "
"number_asc [číslo_vzestupně], number_desc [číslo_sestupně] ) " "number_asc [číslo_vzestupně], number_desc [číslo_sestupně] ) "
#, fuzzy
msgid ""
"keep only unique numbers in hotlist (this applies only on hotlist items "
"where name is NOT displayed after number)"
msgstr ""
"maximální počet jmen v hotlistu (0 = žádné jméno není zobrazeno, pouze čísla "
"bufferů)"
msgid "" msgid ""
"share commands, text, or both in input for all buffers (there is still local " "share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)" "history for each buffer)"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n" "Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-10-12 08:24+0200\n" "POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: 2010-10-11 16:32+0200\n" "PO-Revision-Date: 2010-10-11 16:32+0200\n"
"Last-Translator: Nils G.\n" "Last-Translator: Nils G.\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1886,6 +1886,14 @@ msgstr ""
"Sortierung der Hotlist (group_time_asc (Standardwert), group_time_desc, " "Sortierung der Hotlist (group_time_asc (Standardwert), group_time_desc, "
"group_number_asc, group_number_desc, number_asc, number_desc)" "group_number_asc, group_number_desc, number_asc, number_desc)"
#, fuzzy
msgid ""
"keep only unique numbers in hotlist (this applies only on hotlist items "
"where name is NOT displayed after number)"
msgstr ""
"Maximale Anzahl an Namen in der Hotlist (0 = keine Namen, nur die Anzahl der "
"Buffer)"
#, fuzzy #, fuzzy
msgid "" msgid ""
"share commands, text, or both in input for all buffers (there is still local " "share commands, text, or both in input for all buffers (there is still local "

View File

@ -21,7 +21,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n" "Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-10-12 08:24+0200\n" "POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n" "PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1828,6 +1828,14 @@ msgstr ""
"group_time_desc, group_number_asc, group_number_desc, number_asc, " "group_time_desc, group_number_asc, group_number_desc, number_asc, "
"number_desc)" "number_desc)"
#, fuzzy
msgid ""
"keep only unique numbers in hotlist (this applies only on hotlist items "
"where name is NOT displayed after number)"
msgstr ""
"número máximo de nombres en la lista de actividad (0 = no se muestra "
"ninguno, sólo los números de buffer)"
msgid "" msgid ""
"share commands, text, or both in input for all buffers (there is still local " "share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)" "history for each buffer)"

View File

@ -21,8 +21,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n" "Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-10-12 08:24+0200\n" "POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: 2010-10-12 08:25+0200\n" "PO-Revision-Date: 2010-10-12 12:58+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n" "Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n" "Language: French\n"
@ -1835,7 +1835,7 @@ msgid ""
"if set, uses short names to display buffer names in hotlist (start after " "if set, uses short names to display buffer names in hotlist (start after "
"first '.' in name)" "first '.' in name)"
msgstr "" msgstr ""
"si défini, utilie des noms courts pour afficher les noms de tampons dans la " "si défini, utilise des noms courts pour afficher les noms de tampons dans la "
"hotlist (commence après le premier '.' dans le nom)" "hotlist (commence après le premier '.' dans le nom)"
msgid "" msgid ""
@ -1846,6 +1846,14 @@ msgstr ""
"group_time_desc, group_number_asc, group_number_desc, number_asc, " "group_time_desc, group_number_asc, group_number_desc, number_asc, "
"number_desc)" "number_desc)"
msgid ""
"keep only unique numbers in hotlist (this applies only on hotlist items "
"where name is NOT displayed after number)"
msgstr ""
"garde seulement des numéros uniques dans la hotlist (cela s'applique "
"seulement aux éléments de la hotlist où le nom n'est PAS affiché après le "
"numéro)"
msgid "" msgid ""
"share commands, text, or both in input for all buffers (there is still local " "share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)" "history for each buffer)"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n" "Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-10-12 08:24+0200\n" "POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n" "PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1594,6 +1594,11 @@ msgid ""
"group_number_asc, group_number_desc, number_asc, number_desc)" "group_number_asc, group_number_desc, number_asc, number_desc)"
msgstr "" msgstr ""
msgid ""
"keep only unique numbers in hotlist (this applies only on hotlist items "
"where name is NOT displayed after number)"
msgstr ""
msgid "" msgid ""
"share commands, text, or both in input for all buffers (there is still local " "share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)" "history for each buffer)"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n" "Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-10-12 08:24+0200\n" "POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: 2010-10-10 19:30+0200\n" "PO-Revision-Date: 2010-10-10 19:30+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n" "Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1836,6 +1836,14 @@ msgstr ""
"group_time_desc, group_number_asc, group_number_desc, number_asc, " "group_time_desc, group_number_asc, group_number_desc, number_asc, "
"number_desc)" "number_desc)"
#, fuzzy
msgid ""
"keep only unique numbers in hotlist (this applies only on hotlist items "
"where name is NOT displayed after number)"
msgstr ""
"numero massimo di nomi nella hotlist (0 = nessun nome visualizzato, solo "
"numeri dei buffer)"
msgid "" msgid ""
"share commands, text, or both in input for all buffers (there is still local " "share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)" "history for each buffer)"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n" "Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-10-12 08:24+0200\n" "POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n" "PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n" "Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1835,6 +1835,14 @@ msgstr ""
"typ sortowania hotlisty (group_time_asc (domyślny), group_time_desc, " "typ sortowania hotlisty (group_time_asc (domyślny), group_time_desc, "
"group_number_asc, group_number_desc, number_asc, number_desc)" "group_number_asc, group_number_desc, number_asc, number_desc)"
#, fuzzy
msgid ""
"keep only unique numbers in hotlist (this applies only on hotlist items "
"where name is NOT displayed after number)"
msgstr ""
"maksymalna ilość nazw w hotliście (0 = żadna nazwa nie zostanie wyświetlona, "
"tylko numery buforów)"
msgid "" msgid ""
"share commands, text, or both in input for all buffers (there is still local " "share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)" "history for each buffer)"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n" "Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-10-12 08:24+0200\n" "POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n" "PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n" "Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1609,6 +1609,14 @@ msgstr ""
"тип сортировки хотлиста (group_time_asc (по-умолчанию), group_time_desc, " "тип сортировки хотлиста (group_time_asc (по-умолчанию), group_time_desc, "
"group_number_asc, group_number_desc, number_asc, number_desc)" "group_number_asc, group_number_desc, number_asc, number_desc)"
#, fuzzy
msgid ""
"keep only unique numbers in hotlist (this applies only on hotlist items "
"where name is NOT displayed after number)"
msgstr ""
"максимальное количество имён в хотлисте (0 = имена не показываются, только "
"номера буферов)"
msgid "" msgid ""
"share commands, text, or both in input for all buffers (there is still local " "share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)" "history for each buffer)"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-10-12 08:24+0200\n" "POT-Creation-Date: 2010-10-12 12:58+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -1376,6 +1376,11 @@ msgid ""
"group_number_asc, group_number_desc, number_asc, number_desc)" "group_number_asc, group_number_desc, number_asc, number_desc)"
msgstr "" msgstr ""
msgid ""
"keep only unique numbers in hotlist (this applies only on hotlist items "
"where name is NOT displayed after number)"
msgstr ""
msgid "" msgid ""
"share commands, text, or both in input for all buffers (there is still local " "share commands, text, or both in input for all buffers (there is still local "
"history for each buffer)" "history for each buffer)"

View File

@ -90,6 +90,7 @@ struct t_config_option *config_look_hotlist_names_level;
struct t_config_option *config_look_hotlist_names_merged_buffers; struct t_config_option *config_look_hotlist_names_merged_buffers;
struct t_config_option *config_look_hotlist_short_names; struct t_config_option *config_look_hotlist_short_names;
struct t_config_option *config_look_hotlist_sort; struct t_config_option *config_look_hotlist_sort;
struct t_config_option *config_look_hotlist_unique_numbers;
struct t_config_option *config_look_input_share; struct t_config_option *config_look_input_share;
struct t_config_option *config_look_input_share_overwrite; struct t_config_option *config_look_input_share_overwrite;
struct t_config_option *config_look_input_undo_max; struct t_config_option *config_look_input_undo_max;
@ -1372,6 +1373,12 @@ config_weechat_init_options ()
"group_time_asc|group_time_desc|group_number_asc|" "group_time_asc|group_time_desc|group_number_asc|"
"group_number_desc|number_asc|number_desc", "group_number_desc|number_asc|number_desc",
0, 0, "group_time_asc", NULL, 0, NULL, NULL, &config_change_hotlist, NULL, NULL, NULL); 0, 0, "group_time_asc", NULL, 0, NULL, NULL, &config_change_hotlist, NULL, NULL, NULL);
config_look_hotlist_unique_numbers = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_unique_numbers", "boolean",
N_("keep only unique numbers in hotlist (this applies only on hotlist "
"items where name is NOT displayed after number)"),
NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
config_look_input_share = config_file_new_option ( config_look_input_share = config_file_new_option (
weechat_config_file, ptr_section, weechat_config_file, ptr_section,
"input_share", "integer", "input_share", "integer",

View File

@ -119,6 +119,7 @@ extern struct t_config_option *config_look_hotlist_names_level;
extern struct t_config_option *config_look_hotlist_names_merged_buffers; extern struct t_config_option *config_look_hotlist_names_merged_buffers;
extern struct t_config_option *config_look_hotlist_short_names; extern struct t_config_option *config_look_hotlist_short_names;
extern struct t_config_option *config_look_hotlist_sort; extern struct t_config_option *config_look_hotlist_sort;
extern struct t_config_option *config_look_hotlist_unique_numbers;
extern struct t_config_option *config_look_input_share; extern struct t_config_option *config_look_input_share;
extern struct t_config_option *config_look_input_share_overwrite; extern struct t_config_option *config_look_input_share_overwrite;
extern struct t_config_option *config_look_input_undo_max; extern struct t_config_option *config_look_input_undo_max;

View File

@ -979,9 +979,9 @@ char *
gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item, gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
struct t_gui_window *window) struct t_gui_window *window)
{ {
char buf[1024], format[32]; char buf[1024], format[32], *buffer_without_name_displayed;
struct t_gui_hotlist *ptr_hotlist; struct t_gui_hotlist *ptr_hotlist;
int names_count, display_name; int numbers_count, names_count, display_name;
/* make C compiler happy */ /* make C compiler happy */
(void) data; (void) data;
@ -995,6 +995,15 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
strcat (buf, _("Act: ")); strcat (buf, _("Act: "));
buffer_without_name_displayed = NULL;
if (CONFIG_BOOLEAN(config_look_hotlist_unique_numbers) && last_gui_buffer)
{
buffer_without_name_displayed = malloc (last_gui_buffer->number);
if (buffer_without_name_displayed)
memset (buffer_without_name_displayed, 0, last_gui_buffer->number);
}
numbers_count = 0;
names_count = 0; names_count = 0;
for (ptr_hotlist = gui_hotlist; ptr_hotlist; for (ptr_hotlist = gui_hotlist; ptr_hotlist;
ptr_hotlist = ptr_hotlist->next_hotlist) ptr_hotlist = ptr_hotlist->next_hotlist)
@ -1022,37 +1031,52 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
break; break;
} }
sprintf (buf + strlen (buf), "%d", ptr_hotlist->buffer->number); display_name = ((CONFIG_BOOLEAN(config_look_hotlist_names_merged_buffers)
&& (gui_buffer_count_merged_buffers (ptr_hotlist->buffer->number) > 1))
|| (display_name
&& (CONFIG_INTEGER(config_look_hotlist_names_count) != 0)
&& (names_count < CONFIG_INTEGER(config_look_hotlist_names_count))));
if ((CONFIG_BOOLEAN(config_look_hotlist_names_merged_buffers) if (display_name || !buffer_without_name_displayed
&& (gui_buffer_count_merged_buffers (ptr_hotlist->buffer->number) > 1)) || (buffer_without_name_displayed[ptr_hotlist->buffer->number - 1] == 0))
|| (display_name
&& (CONFIG_INTEGER(config_look_hotlist_names_count) != 0)
&& (names_count < CONFIG_INTEGER(config_look_hotlist_names_count))))
{ {
names_count++; if (numbers_count > 0)
strcat (buf, ",");
strcat (buf, GUI_COLOR_CUSTOM_BAR_DELIM); numbers_count++;
strcat (buf, ":"); sprintf (buf + strlen (buf), "%d", ptr_hotlist->buffer->number);
strcat (buf, GUI_COLOR_CUSTOM_BAR_FG);
if (CONFIG_INTEGER(config_look_hotlist_names_length) == 0) if (display_name)
snprintf (format, sizeof (format) - 1, "%%s"); {
names_count++;
strcat (buf, GUI_COLOR_CUSTOM_BAR_DELIM);
strcat (buf, ":");
strcat (buf, GUI_COLOR_CUSTOM_BAR_FG);
if (CONFIG_INTEGER(config_look_hotlist_names_length) == 0)
snprintf (format, sizeof (format) - 1, "%%s");
else
snprintf (format, sizeof (format) - 1,
"%%.%ds",
CONFIG_INTEGER(config_look_hotlist_names_length));
sprintf (buf + strlen (buf), format,
(CONFIG_BOOLEAN(config_look_hotlist_short_names)) ?
ptr_hotlist->buffer->short_name : ptr_hotlist->buffer->name);
}
else else
snprintf (format, sizeof (format) - 1, {
"%%.%ds", if (buffer_without_name_displayed)
CONFIG_INTEGER(config_look_hotlist_names_length)); buffer_without_name_displayed[ptr_hotlist->buffer->number - 1] = 1;
sprintf (buf + strlen (buf), format, }
(CONFIG_BOOLEAN(config_look_hotlist_short_names)) ?
ptr_hotlist->buffer->short_name : ptr_hotlist->buffer->name); if (strlen (buf) > sizeof (buf) - 32)
break;
} }
if (ptr_hotlist->next_hotlist)
strcat (buf, ",");
if (strlen (buf) > sizeof (buf) - 32)
break;
} }
if (buffer_without_name_displayed)
free (buffer_without_name_displayed);
return strdup (buf); return strdup (buf);
} }