From e2ae308e3b9556b31a8e16550d0c3afdcbb36abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Thu, 11 Sep 2025 21:10:52 +0200 Subject: [PATCH] core: add option weechat.completion.cycle --- CHANGELOG.md | 4 ++++ po/cs.po | 7 ++++++- po/de.po | 7 ++++++- po/es.po | 7 ++++++- po/fr.po | 11 +++++++++-- po/hu.po | 7 ++++++- po/it.po | 7 ++++++- po/ja.po | 7 ++++++- po/pl.po | 7 ++++++- po/pt.po | 7 ++++++- po/pt_BR.po | 7 ++++++- po/ru.po | 7 ++++++- po/sr.po | 7 ++++++- po/tr.po | 7 ++++++- po/weechat.pot | 7 ++++++- src/core/core-config.c | 9 +++++++++ src/core/core-config.h | 1 + src/gui/gui-completion.c | 3 ++- 18 files changed, 103 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2b2bdf95..53c986fe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ SPDX-License-Identifier: GPL-3.0-or-later ## Version 4.8.0 (under dev) +### Added + +- core: add option weechat.completion.cycle + ### Changed - api: add support of date like ISO 8601 but with spaces and lower `t` and `z` in function util_parse_time ([#886](https://github.com/weechat/weechat/issues/886)) diff --git a/po/cs.po b/po/cs.po index bd4cb9916..0f6e44af1 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-08-16 19:26+0200\n" +"POT-Creation-Date: 2025-09-11 21:08+0200\n" "PO-Revision-Date: 2025-05-04 09:24+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -5395,6 +5395,11 @@ msgid "" "with \"/\" (outside commands arguments)" msgstr "" +msgid "" +"if enabled, restart from beginning (first completion found) when the last " +"completion is reached, otherwise stop at last completion" +msgstr "" + #, fuzzy msgid "" "default completion template (please see documentation for template codes and " diff --git a/po/de.po b/po/de.po index 9934dbfe2..59fecd5a9 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-08-16 19:26+0200\n" +"POT-Creation-Date: 2025-09-11 21:08+0200\n" "PO-Revision-Date: 2025-05-05 09:24+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -6149,6 +6149,11 @@ msgstr "" "Verzeichnissen, die mit \"/\" beginnen, funktioniert außerhalb von Befehlen " "nicht mehr" +msgid "" +"if enabled, restart from beginning (first completion found) when the last " +"completion is reached, otherwise stop at last completion" +msgstr "" + msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" diff --git a/po/es.po b/po/es.po index 9047ade32..bc5945ee1 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-08-16 19:26+0200\n" +"POT-Creation-Date: 2025-09-11 21:08+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -5535,6 +5535,11 @@ msgid "" "with \"/\" (outside commands arguments)" msgstr "" +msgid "" +"if enabled, restart from beginning (first completion found) when the last " +"completion is reached, otherwise stop at last completion" +msgstr "" + #, fuzzy msgid "" "default completion template (please see documentation for template codes and " diff --git a/po/fr.po b/po/fr.po index dd0f733b8..df0d615e5 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-08-16 19:26+0200\n" -"PO-Revision-Date: 2025-08-16 19:27+0200\n" +"POT-Creation-Date: 2025-09-11 21:08+0200\n" +"PO-Revision-Date: 2025-09-11 21:09+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -6021,6 +6021,13 @@ msgstr "" "plus de complétion automatique des chemins commençant par \"/\" (en dehors " "des paramètres de commandes)" +msgid "" +"if enabled, restart from beginning (first completion found) when the last " +"completion is reached, otherwise stop at last completion" +msgstr "" +"si activé, redémarrer au début (première complétion trouvée) lorsque la " +"dernière complétion est atteinte, sinon stopper à la dernière complétion" + msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" diff --git a/po/hu.po b/po/hu.po index b8324fe07..8cff0ac27 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-08-16 19:26+0200\n" +"POT-Creation-Date: 2025-09-11 21:08+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -5109,6 +5109,11 @@ msgid "" "with \"/\" (outside commands arguments)" msgstr "" +msgid "" +"if enabled, restart from beginning (first completion found) when the last " +"completion is reached, otherwise stop at last completion" +msgstr "" + msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" diff --git a/po/it.po b/po/it.po index 60754bd61..499d9999b 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-08-16 19:26+0200\n" +"POT-Creation-Date: 2025-09-11 21:08+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -5518,6 +5518,11 @@ msgid "" "with \"/\" (outside commands arguments)" msgstr "" +msgid "" +"if enabled, restart from beginning (first completion found) when the last " +"completion is reached, otherwise stop at last completion" +msgstr "" + msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" diff --git a/po/ja.po b/po/ja.po index f7810cdf6..f812e2113 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-08-16 19:26+0200\n" +"POT-Creation-Date: 2025-09-11 21:08+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: weechat-dev \n" @@ -5995,6 +5995,11 @@ msgstr "" "włączenie tej opcji wyłącza automatyczne dopełnianie ścieżek zaczynających " "się od \"/\" (poza argumentami komend)" +msgid "" +"if enabled, restart from beginning (first completion found) when the last " +"completion is reached, otherwise stop at last completion" +msgstr "" + msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" diff --git a/po/pt.po b/po/pt.po index a19d86a77..819ad8c08 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-08-16 19:26+0200\n" +"POT-Creation-Date: 2025-09-11 21:08+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -5737,6 +5737,11 @@ msgstr "" "quando esta opção está ativada, já não é possível completar os caminhos " "começados por \"/\" (fora dos argumentos dos comandos)" +msgid "" +"if enabled, restart from beginning (first completion found) when the last " +"completion is reached, otherwise stop at last completion" +msgstr "" + msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" diff --git a/po/pt_BR.po b/po/pt_BR.po index cfab077b4..96b782cb9 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-08-16 19:26+0200\n" +"POT-Creation-Date: 2025-09-11 21:08+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -5438,6 +5438,11 @@ msgid "" "with \"/\" (outside commands arguments)" msgstr "" +msgid "" +"if enabled, restart from beginning (first completion found) when the last " +"completion is reached, otherwise stop at last completion" +msgstr "" + #, fuzzy msgid "" "default completion template (please see documentation for template codes and " diff --git a/po/ru.po b/po/ru.po index 146235af2..6cabb4789 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-08-16 19:26+0200\n" +"POT-Creation-Date: 2025-09-11 21:08+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -5143,6 +5143,11 @@ msgid "" "with \"/\" (outside commands arguments)" msgstr "" +msgid "" +"if enabled, restart from beginning (first completion found) when the last " +"completion is reached, otherwise stop at last completion" +msgstr "" + msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" diff --git a/po/sr.po b/po/sr.po index 8de1ac2a5..2bba5fdf7 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-08-16 19:26+0200\n" +"POT-Creation-Date: 2025-09-11 21:08+0200\n" "PO-Revision-Date: 2025-07-09 15:48+0400\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -5815,6 +5815,11 @@ msgstr "" "опција укључи, више се не врши аутоматско довршавање путања које почињу са " "„/” (ван аргумената команде)" +msgid "" +"if enabled, restart from beginning (first completion found) when the last " +"completion is reached, otherwise stop at last completion" +msgstr "" + msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" diff --git a/po/tr.po b/po/tr.po index 0a3af918f..fd7fc1274 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-08-16 19:26+0200\n" +"POT-Creation-Date: 2025-09-11 21:08+0200\n" "PO-Revision-Date: 2025-07-06 09:25+0200\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -5604,6 +5604,11 @@ msgstr "" "seçenek etkinleştirildiğinde \"/\" ile başlayan yollar için kendiliğinden " "tamamlama artık kullanılamaz (komut argümanları dışında)" +msgid "" +"if enabled, restart from beginning (first completion found) when the last " +"completion is reached, otherwise stop at last completion" +msgstr "" + msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" diff --git a/po/weechat.pot b/po/weechat.pot index d5a84929c..52ae7ecd5 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-08-16 19:26+0200\n" +"POT-Creation-Date: 2025-09-11 21:08+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -4770,6 +4770,11 @@ msgid "" "with \"/\" (outside commands arguments)" msgstr "" +msgid "" +"if enabled, restart from beginning (first completion found) when the last " +"completion is reached, otherwise stop at last completion" +msgstr "" + msgid "" "default completion template (please see documentation for template codes and " "values: plugin API reference, function \"weechat_hook_command\")" diff --git a/src/core/core-config.c b/src/core/core-config.c index 2659fed92..a0eb7f282 100644 --- a/src/core/core-config.c +++ b/src/core/core-config.c @@ -305,6 +305,7 @@ struct t_config_option *config_color_status_time = NULL; struct t_config_option *config_completion_base_word_until_cursor = NULL; struct t_config_option *config_completion_case_sensitive = NULL; struct t_config_option *config_completion_command_inline = NULL; +struct t_config_option *config_completion_cycle = NULL; struct t_config_option *config_completion_default_template = NULL; struct t_config_option *config_completion_nick_add_space = NULL; struct t_config_option *config_completion_nick_case_sensitive = NULL; @@ -5185,6 +5186,14 @@ config_weechat_init_options (void) "commands arguments)"), NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_cycle = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "cycle", "boolean", + N_("if enabled, restart from beginning (first completion found) " + "when the last completion is reached, otherwise stop at last " + "completion"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_default_template = config_file_new_option ( weechat_config_file, weechat_config_section_completion, "default_template", "string", diff --git a/src/core/core-config.h b/src/core/core-config.h index 7be289a26..ddb4fdbd7 100644 --- a/src/core/core-config.h +++ b/src/core/core-config.h @@ -354,6 +354,7 @@ extern struct t_config_option *config_color_status_time; extern struct t_config_option *config_completion_base_word_until_cursor; extern struct t_config_option *config_completion_case_sensitive; extern struct t_config_option *config_completion_command_inline; +extern struct t_config_option *config_completion_cycle; extern struct t_config_option *config_completion_default_template; extern struct t_config_option *config_completion_nick_add_space; extern struct t_config_option *config_completion_nick_case_sensitive; diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c index 403221f92..d5aed40d5 100644 --- a/src/gui/gui-completion.c +++ b/src/gui/gui-completion.c @@ -1384,7 +1384,8 @@ gui_completion_complete (struct t_gui_completion *completion) * if we was on last completion in list, then complete again, starting from * first matching item */ - if (completion->word_found && (completion->position >= 0)) + if (CONFIG_BOOLEAN(config_completion_cycle) + && completion->word_found && (completion->position >= 0)) { free (completion->word_found); completion->word_found = NULL;