From d8569ffe27e96251b43cfee519e15f588ae604a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 28 Nov 2025 18:45:22 +0100 Subject: [PATCH] buflist: add variable `${index_displayed}` --- CHANGELOG.md | 1 + po/cs.po | 8 +++++++- po/de.po | 8 +++++++- po/es.po | 8 +++++++- po/fr.po | 13 +++++++++++-- po/hu.po | 8 +++++++- po/it.po | 8 +++++++- po/ja.po | 8 +++++++- po/pl.po | 8 +++++++- po/pt.po | 8 +++++++- po/pt_BR.po | 8 +++++++- po/ru.po | 8 +++++++- po/sr.po | 8 +++++++- po/tr.po | 8 +++++++- po/weechat.pot | 8 +++++++- src/plugins/buflist/buflist-bar-item.c | 7 ++++++- src/plugins/buflist/buflist-command.c | 5 ++++- 17 files changed, 113 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f9c73df5..bddc237d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - core: add option weechat.completion.cycle - core: add hdata for hooks - api: add functions util_parse_int, util_parse_long and util_parse_longlong +- buflist: add variable `${index_displayed}` ### Removed diff --git a/po/cs.po b/po/cs.po index 640d5f6e7..30130c315 100644 --- a/po/cs.po +++ b/po/cs.po @@ -23,7 +23,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-11-28 18:38+0100\n" +"POT-Creation-Date: 2025-11-28 18:41+0100\n" "PO-Revision-Date: 2025-10-27 08:26+0100\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -7013,6 +7013,12 @@ msgid "" "empty for channels (evaluation of option buflist.format.tls_version)" msgstr "" +msgid "" +" - ${index_displayed}: index of line displayed in the bar item (starts at " +"0, only buffers displayed increment this index, see option " +"buflist.look.display_conditions" +msgstr "" + #, fuzzy #| msgid "list of bar items" msgid "buflist bar items" diff --git a/po/de.po b/po/de.po index c4eb5d9de..0f7ecab85 100644 --- a/po/de.po +++ b/po/de.po @@ -28,7 +28,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-11-28 18:38+0100\n" +"POT-Creation-Date: 2025-11-28 18:41+0100\n" "PO-Revision-Date: 2025-11-09 11:00+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -7962,6 +7962,12 @@ msgstr "" " - ${format_tls_version}: Indikator der TLS Version für den Serverbuffer, " "Channels bleiben unberührt (evaluiert aus Option buflist.format.tls_version)" +msgid "" +" - ${index_displayed}: index of line displayed in the bar item (starts at " +"0, only buffers displayed increment this index, see option " +"buflist.look.display_conditions" +msgstr "" + msgid "buflist bar items" msgstr "Buflist Bar-Items" diff --git a/po/es.po b/po/es.po index 24492cb21..36443c760 100644 --- a/po/es.po +++ b/po/es.po @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-11-28 18:38+0100\n" +"POT-Creation-Date: 2025-11-28 18:41+0100\n" "PO-Revision-Date: 2025-10-27 08:26+0100\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -7194,6 +7194,12 @@ msgid "" "empty for channels (evaluation of option buflist.format.tls_version)" msgstr "" +msgid "" +" - ${index_displayed}: index of line displayed in the bar item (starts at " +"0, only buffers displayed increment this index, see option " +"buflist.look.display_conditions" +msgstr "" + #, fuzzy #| msgid "list of bar items" msgid "buflist bar items" diff --git a/po/fr.po b/po/fr.po index 171adea32..34c4ab624 100644 --- a/po/fr.po +++ b/po/fr.po @@ -23,8 +23,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-11-28 18:38+0100\n" -"PO-Revision-Date: 2025-11-28 18:40+0100\n" +"POT-Creation-Date: 2025-11-28 18:41+0100\n" +"PO-Revision-Date: 2025-11-28 18:42+0100\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -7811,6 +7811,15 @@ msgstr "" "serveur courant, vide pour les canaux (évaluation de l'option " "buflist.format.tls_version)" +msgid "" +" - ${index_displayed}: index of line displayed in the bar item (starts at " +"0, only buffers displayed increment this index, see option " +"buflist.look.display_conditions" +msgstr "" +" - ${index_displayed} : index de la ligne affichée dans l'objet de barre " +"(démarre à 0, seuls les tampons affichés incrémentent cet index, voir " +"l'option buflist.look.display_conditions" + msgid "buflist bar items" msgstr "objets de barre de buflist" diff --git a/po/hu.po b/po/hu.po index 2e6b33b5d..39008545a 100644 --- a/po/hu.po +++ b/po/hu.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-11-28 18:38+0100\n" +"POT-Creation-Date: 2025-11-28 18:41+0100\n" "PO-Revision-Date: 2025-10-27 08:27+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -6653,6 +6653,12 @@ msgid "" "empty for channels (evaluation of option buflist.format.tls_version)" msgstr "" +msgid "" +" - ${index_displayed}: index of line displayed in the bar item (starts at " +"0, only buffers displayed increment this index, see option " +"buflist.look.display_conditions" +msgstr "" + #, fuzzy msgid "buflist bar items" msgstr "Aliaszok listája:\n" diff --git a/po/it.po b/po/it.po index 8cb49af4c..5d7577a6f 100644 --- a/po/it.po +++ b/po/it.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-11-28 18:38+0100\n" +"POT-Creation-Date: 2025-11-28 18:41+0100\n" "PO-Revision-Date: 2025-10-27 08:27+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -7139,6 +7139,12 @@ msgid "" "empty for channels (evaluation of option buflist.format.tls_version)" msgstr "" +msgid "" +" - ${index_displayed}: index of line displayed in the bar item (starts at " +"0, only buffers displayed increment this index, see option " +"buflist.look.display_conditions" +msgstr "" + #, fuzzy #| msgid "list of bar items" msgid "buflist bar items" diff --git a/po/ja.po b/po/ja.po index b9eee91f0..e7cd52e90 100644 --- a/po/ja.po +++ b/po/ja.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-11-28 18:38+0100\n" +"POT-Creation-Date: 2025-11-28 18:41+0100\n" "PO-Revision-Date: 2025-11-01 16:08+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: weechat-dev \n" @@ -7769,6 +7769,12 @@ msgstr "" " - ${format_tls_version}: wskaźnik wersji TLS w buforze serwera, pusty " "dla kanałów (wynik przetworzenia opcji buflist.format.tls_version)" +msgid "" +" - ${index_displayed}: index of line displayed in the bar item (starts at " +"0, only buffers displayed increment this index, see option " +"buflist.look.display_conditions" +msgstr "" + msgid "buflist bar items" msgstr "elementy paska buflist" diff --git a/po/pt.po b/po/pt.po index 0527f713e..dc580dcd8 100644 --- a/po/pt.po +++ b/po/pt.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-11-28 18:38+0100\n" +"POT-Creation-Date: 2025-11-28 18:41+0100\n" "PO-Revision-Date: 2025-10-27 08:27+0100\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -7407,6 +7407,12 @@ msgid "" "empty for channels (evaluation of option buflist.format.tls_version)" msgstr "" +msgid "" +" - ${index_displayed}: index of line displayed in the bar item (starts at " +"0, only buffers displayed increment this index, see option " +"buflist.look.display_conditions" +msgstr "" + #, fuzzy #| msgid "list of bar items" msgid "buflist bar items" diff --git a/po/pt_BR.po b/po/pt_BR.po index 9d89287fb..10804776e 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -23,7 +23,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-11-28 18:38+0100\n" +"POT-Creation-Date: 2025-11-28 18:41+0100\n" "PO-Revision-Date: 2025-10-27 08:27+0100\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -7037,6 +7037,12 @@ msgid "" "empty for channels (evaluation of option buflist.format.tls_version)" msgstr "" +msgid "" +" - ${index_displayed}: index of line displayed in the bar item (starts at " +"0, only buffers displayed increment this index, see option " +"buflist.look.display_conditions" +msgstr "" + #, fuzzy #| msgid "list of bar items" msgid "buflist bar items" diff --git a/po/ru.po b/po/ru.po index ddacffe87..4cf58d3f5 100644 --- a/po/ru.po +++ b/po/ru.po @@ -23,7 +23,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-11-28 18:38+0100\n" +"POT-Creation-Date: 2025-11-28 18:41+0100\n" "PO-Revision-Date: 2025-10-27 08:27+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -6694,6 +6694,12 @@ msgid "" "empty for channels (evaluation of option buflist.format.tls_version)" msgstr "" +msgid "" +" - ${index_displayed}: index of line displayed in the bar item (starts at " +"0, only buffers displayed increment this index, see option " +"buflist.look.display_conditions" +msgstr "" + #, fuzzy msgid "buflist bar items" msgstr "Список сокращений:\n" diff --git a/po/sr.po b/po/sr.po index f2a76b44b..90a849de6 100644 --- a/po/sr.po +++ b/po/sr.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-11-28 18:38+0100\n" +"POT-Creation-Date: 2025-11-28 18:41+0100\n" "PO-Revision-Date: 2025-11-24 14:27+0400\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -7562,6 +7562,12 @@ msgstr "" " - ${format_tls_version}: индикатор TLS верзије за серверски бафер, " "празно за канале (резултат израчунавања опције buflist.format.tls_version)" +msgid "" +" - ${index_displayed}: index of line displayed in the bar item (starts at " +"0, only buffers displayed increment this index, see option " +"buflist.look.display_conditions" +msgstr "" + msgid "buflist bar items" msgstr "ставке buflist траке" diff --git a/po/tr.po b/po/tr.po index 6736c41cc..dce002a70 100644 --- a/po/tr.po +++ b/po/tr.po @@ -23,7 +23,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-11-28 18:38+0100\n" +"POT-Creation-Date: 2025-11-28 18:41+0100\n" "PO-Revision-Date: 2025-11-01 16:08+0100\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -7330,6 +7330,12 @@ msgid "" "empty for channels (evaluation of option buflist.format.tls_version)" msgstr "" +msgid "" +" - ${index_displayed}: index of line displayed in the bar item (starts at " +"0, only buffers displayed increment this index, see option " +"buflist.look.display_conditions" +msgstr "" + #, fuzzy #| msgid "list of bar items" msgid "buflist bar items" diff --git a/po/weechat.pot b/po/weechat.pot index 3ab249717..65e048903 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -23,7 +23,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-11-28 18:38+0100\n" +"POT-Creation-Date: 2025-11-28 18:41+0100\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -6209,6 +6209,12 @@ msgid "" "empty for channels (evaluation of option buflist.format.tls_version)" msgstr "" +msgid "" +" - ${index_displayed}: index of line displayed in the bar item (starts at " +"0, only buffers displayed increment this index, see option " +"buflist.look.display_conditions" +msgstr "" + msgid "buflist bar items" msgstr "" diff --git a/src/plugins/buflist/buflist-bar-item.c b/src/plugins/buflist/buflist-bar-item.c index 3628d62a3..44f063a7c 100644 --- a/src/plugins/buflist/buflist-bar-item.c +++ b/src/plugins/buflist/buflist-bar-item.c @@ -332,7 +332,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, int item_index, num_buffers, is_channel, is_private, is_list; int i, j, length_max_number, current_buffer, number, prev_number, priority; int rc, count, line_number, line_number_current_buffer; - int hotlist_priority_number; + int hotlist_priority_number, index_displayed; /* make C compiler happy */ (void) data; @@ -350,6 +350,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, prev_number = -1; line_number = 0; line_number_current_buffer = 0; + index_displayed = 0; buflist = weechat_string_dyn_alloc (256); @@ -658,6 +659,10 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, if (current_buffer) line_number_current_buffer = line_number; prev_number = number; + snprintf (str_number, sizeof (str_number), "%d", index_displayed); + weechat_hashtable_set (buflist_hashtable_extra_vars, + "index_displayed", str_number); + index_displayed++; /* add newline between each buffer (if needed) */ if (weechat_config_boolean (buflist_config_look_add_newline) diff --git a/src/plugins/buflist/buflist-command.c b/src/plugins/buflist/buflist-command.c index 616278429..1d5105207 100644 --- a/src/plugins/buflist/buflist-command.c +++ b/src/plugins/buflist/buflist-command.c @@ -196,7 +196,10 @@ buflist_command_init (void) "there's no lag (evaluation of option buflist.format.lag)"), N_(" - ${format_tls_version}: indicator of TLS version for a server " "buffer, empty for channels (evaluation of option " - "buflist.format.tls_version)")), + "buflist.format.tls_version)"), + N_(" - ${index_displayed}: index of line displayed in the bar " + "item (starts at 0, only buffers displayed increment this index, " + "see option buflist.look.display_conditions")), "enable|disable|toggle" " || bar" " || refresh %(buflist_items_used)|%*",