diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 47cd559a1..ab3592e9b 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -28,6 +28,7 @@ New features:: * core: add option "recreate" in command /filter * core: add raw string in evaluation of expressions with "raw:xxx" (issue #1611) * core: add evaluation of conditions in evaluation of expressions with "eval_cond:" (issue #1582) + * buflist: add option buflist.look.use_items to speed up display of buflist (issue #1613) * irc: add info "irc_is_message_ignored" * irc: add server option "default_chantypes", used when the server does not send them in message 005 (issue #1610) * trigger: add variable "${tg_trigger_name}" in command trigger evaluated strings (issue #1580) diff --git a/ReleaseNotes.adoc b/ReleaseNotes.adoc index 84793ccd7..ca069cd7a 100644 --- a/ReleaseNotes.adoc +++ b/ReleaseNotes.adoc @@ -20,6 +20,19 @@ https://weechat.org/files/changelog/ChangeLog-devel.html[ChangeLog] [[v3.1]] == Version 3.1 (under dev) +[[v3.1_buflist_option_use_items]] +=== Buflist option buflist.look.use_items + +A new buflist option `buflist.look.use_items` has been added to speed up +display of buflist, in case you use a single buflist item (the most common use case). + +If ever you use more than one item (item "buflist2" or even "buflist3"), you +must adjust the value of the new option, which defaults to 1: + +---- +/set buflist.look.use_items 2 +---- + [[v3.1_window_splitv]] === Vertical split of windows diff --git a/doc/de/includes/autogen_user_options.de.adoc b/doc/de/includes/autogen_user_options.de.adoc index 6b539f70c..e1682bac9 100644 --- a/doc/de/includes/autogen_user_options.de.adoc +++ b/doc/de/includes/autogen_user_options.de.adoc @@ -1781,6 +1781,12 @@ ** Typ: Zeichenkette ** Werte: beliebige Zeichenkette ** Standardwert: `+"number,-active"+` + +* [[option_buflist.look.use_items]] *buflist.look.use_items* +** Beschreibung: pass:none[number of buflist bar items that can be used; the item names are: "buflist", "buflist2", "buflist3"; be careful, using more than one bar item slows down the display of buffers list] +** Typ: integer +** Werte: 1 .. 3 +** Standardwert: `+1+` // end::buflist_options[] // tag::fifo_options[] diff --git a/doc/en/includes/autogen_user_options.en.adoc b/doc/en/includes/autogen_user_options.en.adoc index b958545a4..b141a5418 100644 --- a/doc/en/includes/autogen_user_options.en.adoc +++ b/doc/en/includes/autogen_user_options.en.adoc @@ -1781,6 +1781,12 @@ ** type: string ** values: any string ** default value: `+"number,-active"+` + +* [[option_buflist.look.use_items]] *buflist.look.use_items* +** description: pass:none[number of buflist bar items that can be used; the item names are: "buflist", "buflist2", "buflist3"; be careful, using more than one bar item slows down the display of buffers list] +** type: integer +** values: 1 .. 3 +** default value: `+1+` // end::buflist_options[] // tag::fifo_options[] diff --git a/doc/fr/includes/autogen_user_options.fr.adoc b/doc/fr/includes/autogen_user_options.fr.adoc index 02a487406..f0194ff8f 100644 --- a/doc/fr/includes/autogen_user_options.fr.adoc +++ b/doc/fr/includes/autogen_user_options.fr.adoc @@ -1781,6 +1781,12 @@ ** type: chaîne ** valeurs: toute chaîne ** valeur par défaut: `+"number,-active"+` + +* [[option_buflist.look.use_items]] *buflist.look.use_items* +** description: pass:none[nombre d'objets de barre buflist qui peuvent être utilisés ; les objets de barre sont : "buflist", "buflist2", "buflist3" ; attention, utiliser plus d'un objet de barre ralentit l'affichage de la liste des tampons] +** type: entier +** valeurs: 1 .. 3 +** valeur par défaut: `+1+` // end::buflist_options[] // tag::fifo_options[] diff --git a/doc/it/includes/autogen_user_options.it.adoc b/doc/it/includes/autogen_user_options.it.adoc index 4c920be56..105f0b3c8 100644 --- a/doc/it/includes/autogen_user_options.it.adoc +++ b/doc/it/includes/autogen_user_options.it.adoc @@ -1781,6 +1781,12 @@ ** tipo: stringa ** valori: qualsiasi stringa ** valore predefinito: `+"number,-active"+` + +* [[option_buflist.look.use_items]] *buflist.look.use_items* +** descrizione: pass:none[number of buflist bar items that can be used; the item names are: "buflist", "buflist2", "buflist3"; be careful, using more than one bar item slows down the display of buffers list] +** tipo: intero +** valori: 1 .. 3 +** valore predefinito: `+1+` // end::buflist_options[] // tag::fifo_options[] diff --git a/doc/ja/includes/autogen_user_options.ja.adoc b/doc/ja/includes/autogen_user_options.ja.adoc index b32c5de9e..11efb5aa6 100644 --- a/doc/ja/includes/autogen_user_options.ja.adoc +++ b/doc/ja/includes/autogen_user_options.ja.adoc @@ -1781,6 +1781,12 @@ ** タイプ: 文字列 ** 値: 未制約文字列 ** デフォルト値: `+"number,-active"+` + +* [[option_buflist.look.use_items]] *buflist.look.use_items* +** 説明: pass:none[number of buflist bar items that can be used; the item names are: "buflist", "buflist2", "buflist3"; be careful, using more than one bar item slows down the display of buffers list] +** タイプ: 整数 +** 値: 1 .. 3 +** デフォルト値: `+1+` // end::buflist_options[] // tag::fifo_options[] diff --git a/doc/pl/includes/autogen_user_options.pl.adoc b/doc/pl/includes/autogen_user_options.pl.adoc index 0340efafd..4e31dc9fc 100644 --- a/doc/pl/includes/autogen_user_options.pl.adoc +++ b/doc/pl/includes/autogen_user_options.pl.adoc @@ -1781,6 +1781,12 @@ ** typ: ciąg ** wartości: dowolny ciąg ** domyślna wartość: `+"number,-active"+` + +* [[option_buflist.look.use_items]] *buflist.look.use_items* +** opis: pass:none[number of buflist bar items that can be used; the item names are: "buflist", "buflist2", "buflist3"; be careful, using more than one bar item slows down the display of buffers list] +** typ: liczba +** wartości: 1 .. 3 +** domyślna wartość: `+1+` // end::buflist_options[] // tag::fifo_options[] diff --git a/po/cs.po b/po/cs.po index cfddfac73..b7873f2d5 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-02-08 13:10+0100\n" +"POT-Creation-Date: 2021-02-09 20:31+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -5108,6 +5108,12 @@ msgid "" "pointer to bar_item can be used, for example \"bar_item.name\")" msgstr "" +msgid "" +"number of buflist bar items that can be used; the item names are: \"buflist" +"\", \"buflist2\", \"buflist3\"; be careful, using more than one bar item " +"slows down the display of buffers list" +msgstr "" + msgid "" "format of each line with a buffer (note: content is evaluated, see /help " "buflist); example: standard format for bar item \"buflist\" and only the " diff --git a/po/de.po b/po/de.po index f34d0d498..d745d13da 100644 --- a/po/de.po +++ b/po/de.po @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-02-08 13:10+0100\n" +"POT-Creation-Date: 2021-02-09 20:31+0100\n" "PO-Revision-Date: 2021-02-08 13:38+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -6212,6 +6212,12 @@ msgstr "" "Kleinschreibung unterschieden wird (Hinweis: der Inhalt ist evaluiert, nur " "der Pointer der bar_item kann genutzt werden, Beispiel \"bar_item.name\")" +msgid "" +"number of buflist bar items that can be used; the item names are: \"buflist" +"\", \"buflist2\", \"buflist3\"; be careful, using more than one bar item " +"slows down the display of buffers list" +msgstr "" + msgid "" "format of each line with a buffer (note: content is evaluated, see /help " "buflist); example: standard format for bar item \"buflist\" and only the " diff --git a/po/es.po b/po/es.po index d40dc4d7e..b870b2967 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-02-08 13:10+0100\n" +"POT-Creation-Date: 2021-02-09 20:31+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -5308,6 +5308,12 @@ msgid "" "pointer to bar_item can be used, for example \"bar_item.name\")" msgstr "" +msgid "" +"number of buflist bar items that can be used; the item names are: \"buflist" +"\", \"buflist2\", \"buflist3\"; be careful, using more than one bar item " +"slows down the display of buffers list" +msgstr "" + msgid "" "format of each line with a buffer (note: content is evaluated, see /help " "buflist); example: standard format for bar item \"buflist\" and only the " diff --git a/po/fr.po b/po/fr.po index c5b2e992a..902a2655b 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-02-08 13:10+0100\n" -"PO-Revision-Date: 2021-02-08 13:12+0100\n" +"POT-Creation-Date: 2021-02-09 20:31+0100\n" +"PO-Revision-Date: 2021-02-09 20:25+0100\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -6069,6 +6069,15 @@ msgstr "" "évalué, seul le pointeur vers bar_item peut être utilisé, par exemple " "\"bar_item.name\")" +msgid "" +"number of buflist bar items that can be used; the item names are: \"buflist" +"\", \"buflist2\", \"buflist3\"; be careful, using more than one bar item " +"slows down the display of buffers list" +msgstr "" +"nombre d'objets de barre buflist qui peuvent être utilisés ; les objets de " +"barre sont : \"buflist\", \"buflist2\", \"buflist3\" ; attention, utiliser " +"plus d'un objet de barre ralentit l'affichage de la liste des tampons" + msgid "" "format of each line with a buffer (note: content is evaluated, see /help " "buflist); example: standard format for bar item \"buflist\" and only the " diff --git a/po/hu.po b/po/hu.po index 7ec5ce00b..eca6631fe 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-02-08 13:10+0100\n" +"POT-Creation-Date: 2021-02-09 20:31+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -4646,6 +4646,12 @@ msgid "" "pointer to bar_item can be used, for example \"bar_item.name\")" msgstr "" +msgid "" +"number of buflist bar items that can be used; the item names are: \"buflist" +"\", \"buflist2\", \"buflist3\"; be careful, using more than one bar item " +"slows down the display of buffers list" +msgstr "" + msgid "" "format of each line with a buffer (note: content is evaluated, see /help " "buflist); example: standard format for bar item \"buflist\" and only the " diff --git a/po/it.po b/po/it.po index ccaa263a0..0465ff9cb 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-02-08 13:10+0100\n" +"POT-Creation-Date: 2021-02-09 20:31+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -5442,6 +5442,12 @@ msgid "" "pointer to bar_item can be used, for example \"bar_item.name\")" msgstr "" +msgid "" +"number of buflist bar items that can be used; the item names are: \"buflist" +"\", \"buflist2\", \"buflist3\"; be careful, using more than one bar item " +"slows down the display of buffers list" +msgstr "" + msgid "" "format of each line with a buffer (note: content is evaluated, see /help " "buflist); example: standard format for bar item \"buflist\" and only the " diff --git a/po/ja.po b/po/ja.po index 9e5325e5a..6bff39eb3 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-02-08 13:10+0100\n" +"POT-Creation-Date: 2021-02-09 20:31+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: Polish \n" @@ -5916,6 +5916,12 @@ msgstr "" "(uwaga: zawartość jest przetwarzana, tylko wskaźnik na bar_item może zostać " "użyty, na przykład \"bar_item.name\")" +msgid "" +"number of buflist bar items that can be used; the item names are: \"buflist" +"\", \"buflist2\", \"buflist3\"; be careful, using more than one bar item " +"slows down the display of buffers list" +msgstr "" + msgid "" "format of each line with a buffer (note: content is evaluated, see /help " "buflist); example: standard format for bar item \"buflist\" and only the " diff --git a/po/pt.po b/po/pt.po index d9c855008..ec0b70ec9 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-02-08 13:10+0100\n" +"POT-Creation-Date: 2021-02-09 20:31+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -5709,6 +5709,12 @@ msgid "" "pointer to bar_item can be used, for example \"bar_item.name\")" msgstr "" +msgid "" +"number of buflist bar items that can be used; the item names are: \"buflist" +"\", \"buflist2\", \"buflist3\"; be careful, using more than one bar item " +"slows down the display of buffers list" +msgstr "" + msgid "" "format of each line with a buffer (note: content is evaluated, see /help " "buflist); example: standard format for bar item \"buflist\" and only the " diff --git a/po/pt_BR.po b/po/pt_BR.po index 296e3d8ec..2fe12e3c6 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-02-08 13:10+0100\n" +"POT-Creation-Date: 2021-02-09 20:31+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n" "Last-Translator: Eduardo Elias \n" "Language-Team: weechat-dev \n" @@ -5259,6 +5259,12 @@ msgid "" "pointer to bar_item can be used, for example \"bar_item.name\")" msgstr "" +msgid "" +"number of buflist bar items that can be used; the item names are: \"buflist" +"\", \"buflist2\", \"buflist3\"; be careful, using more than one bar item " +"slows down the display of buffers list" +msgstr "" + msgid "" "format of each line with a buffer (note: content is evaluated, see /help " "buflist); example: standard format for bar item \"buflist\" and only the " diff --git a/po/ru.po b/po/ru.po index 553e98757..2e377e39c 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-02-08 13:10+0100\n" +"POT-Creation-Date: 2021-02-09 20:31+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -4681,6 +4681,12 @@ msgid "" "pointer to bar_item can be used, for example \"bar_item.name\")" msgstr "" +msgid "" +"number of buflist bar items that can be used; the item names are: \"buflist" +"\", \"buflist2\", \"buflist3\"; be careful, using more than one bar item " +"slows down the display of buffers list" +msgstr "" + msgid "" "format of each line with a buffer (note: content is evaluated, see /help " "buflist); example: standard format for bar item \"buflist\" and only the " diff --git a/po/tr.po b/po/tr.po index 094b6e783..4568f57ed 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-02-08 13:10+0100\n" +"POT-Creation-Date: 2021-02-09 20:31+0100\n" "PO-Revision-Date: 2021-02-06 15:55+0100\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -4251,6 +4251,12 @@ msgid "" "pointer to bar_item can be used, for example \"bar_item.name\")" msgstr "" +msgid "" +"number of buflist bar items that can be used; the item names are: \"buflist" +"\", \"buflist2\", \"buflist3\"; be careful, using more than one bar item " +"slows down the display of buffers list" +msgstr "" + msgid "" "format of each line with a buffer (note: content is evaluated, see /help " "buflist); example: standard format for bar item \"buflist\" and only the " diff --git a/po/weechat.pot b/po/weechat.pot index 0e0b1250a..a7936f3a8 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-02-08 13:10+0100\n" +"POT-Creation-Date: 2021-02-09 20:31+0100\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -4234,6 +4234,12 @@ msgid "" "pointer to bar_item can be used, for example \"bar_item.name\")" msgstr "" +msgid "" +"number of buflist bar items that can be used; the item names are: \"buflist" +"\", \"buflist2\", \"buflist3\"; be careful, using more than one bar item " +"slows down the display of buffers list" +msgstr "" + msgid "" "format of each line with a buffer (note: content is evaluated, see /help " "buflist); example: standard format for bar item \"buflist\" and only the " diff --git a/src/plugins/buflist/buflist-bar-item.c b/src/plugins/buflist/buflist-bar-item.c index 89b774d19..88972cf8c 100644 --- a/src/plugins/buflist/buflist-bar-item.c +++ b/src/plugins/buflist/buflist-bar-item.c @@ -103,16 +103,23 @@ 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 force == 2, all items are refreshed. */ void buflist_bar_item_update (int force) { - int i; + int i, num_items; if (force || weechat_config_boolean (buflist_config_look_enabled)) { - for (i = 0; i < BUFLIST_BAR_NUM_ITEMS; 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)); } @@ -318,14 +325,17 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, if (!weechat_config_boolean (buflist_config_look_enabled)) return NULL; + item_index = (int)((unsigned long)pointer); + + if (item_index + 1 > weechat_config_integer (buflist_config_look_use_items)) + return NULL; + prev_number = -1; line_number = 0; line_number_current_buffer = 0; buflist = weechat_string_dyn_alloc (256); - item_index = (int)((unsigned long)pointer); - weechat_hashtable_set (buflist_hashtable_pointers, "bar_item", item); if (window) weechat_hashtable_set (buflist_hashtable_pointers, "window", window); diff --git a/src/plugins/buflist/buflist-config.c b/src/plugins/buflist/buflist-config.c index f187bcfbb..a0691da90 100644 --- a/src/plugins/buflist/buflist-config.c +++ b/src/plugins/buflist/buflist-config.c @@ -44,6 +44,7 @@ struct t_config_option *buflist_config_look_nick_prefix; struct t_config_option *buflist_config_look_nick_prefix_empty; struct t_config_option *buflist_config_look_signals_refresh; struct t_config_option *buflist_config_look_sort; +struct t_config_option *buflist_config_look_use_items; /* buflist config, format section */ @@ -337,6 +338,22 @@ buflist_config_change_nick_prefix (const void *pointer, void *data, buflist_bar_item_update (0); } +/* + * Callback for changes on option "buflist.look.use_items". + */ + +void +buflist_config_change_use_items (const void *pointer, void *data, + struct t_config_option *option) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) option; + + buflist_bar_item_update (2); +} + /* * Callback for changes on options needing bar item refresh. */ @@ -565,6 +582,16 @@ buflist_config_init () NULL, NULL, NULL, &buflist_config_change_sort, NULL, NULL, NULL, NULL, NULL); + buflist_config_look_use_items = weechat_config_new_option ( + buflist_config_file, ptr_section, + "use_items", "integer", + N_("number of buflist bar items that can be used; the item names are: " + "\"buflist\", \"buflist2\", \"buflist3\"; be careful, using more " + "than one bar item slows down the display of buffers list"), + NULL, 1, BUFLIST_BAR_NUM_ITEMS, "1", NULL, 0, + NULL, NULL, NULL, + &buflist_config_change_use_items, NULL, NULL, + NULL, NULL, NULL); /* format */ ptr_section = weechat_config_new_section (buflist_config_file, "format", diff --git a/src/plugins/buflist/buflist-config.h b/src/plugins/buflist/buflist-config.h index a2d68bc8b..1a368fcde 100644 --- a/src/plugins/buflist/buflist-config.h +++ b/src/plugins/buflist/buflist-config.h @@ -45,6 +45,7 @@ extern struct t_config_option *buflist_config_look_nick_prefix; extern struct t_config_option *buflist_config_look_nick_prefix_empty; extern struct t_config_option *buflist_config_look_signals_refresh; extern struct t_config_option *buflist_config_look_sort; +extern struct t_config_option *buflist_config_look_use_items; extern struct t_config_option *buflist_config_format_buffer; extern struct t_config_option *buflist_config_format_buffer_current;