diff --git a/CHANGELOG.md b/CHANGELOG.md index af9c50875..b367e83c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - **breaking:** core: fix buffer overflow in function utf8_next_char and return NULL for empty string - **breaking:** core: fix integer overflow and return "unsigned long" in function util_version_number - core: write configuration files on disk only if there are changes ([#2250](https://github.com/weechat/weechat/issues/2250)) -- core: always enable partial completion for templates in option weechat.completion.partial_completion_templates ([#2253](https://github.com/weechat/weechat/issues/2253)) +- core: always enable partial completion for templates in option weechat.completion.partial_completion_templates, add option weechat.completion.partial_completion_auto_expand to expand word on new completion ([#2253](https://github.com/weechat/weechat/issues/2253)) - core: add script name in output of `/debug hooks ` ### Added diff --git a/po/cs.po b/po/cs.po index f5fa9ff2b..d09c68349 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-05-04 09:21+0200\n" +"POT-Creation-Date: 2025-06-30 09:32+0200\n" "PO-Revision-Date: 2025-05-04 09:24+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -5440,6 +5440,10 @@ msgstr "" msgid "send alert (BEL) when a partial completion occurs" msgstr "upozornit uživatele pokud nastane částečné doplnění" +msgid "" +"automatically expand word after partial completion when completing again" +msgstr "" + msgid "" "partially complete command names (stop when many commands found begin with " "same letters)" @@ -6375,15 +6379,13 @@ msgstr "Myš je vypnuta" msgid " TERM='%s', size: %dx%d" msgstr " TERM='%s', velikost: %dx%d" -#, c-format msgid "Running WeeChat in background..." msgstr "" -#, fuzzy, c-format +#, fuzzy msgid "fork error" msgstr "chyba" -#, c-format msgid "OK" msgstr "OK" diff --git a/po/de.po b/po/de.po index 1addd5fca..1d462478e 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-05-04 09:21+0200\n" +"POT-Creation-Date: 2025-06-30 09:32+0200\n" "PO-Revision-Date: 2025-05-05 09:24+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -6199,6 +6199,10 @@ msgid "send alert (BEL) when a partial completion occurs" msgstr "" "erzeugt eine Mitteilung (BEL) wenn eine teilweise Vervollständigung auftritt" +msgid "" +"automatically expand word after partial completion when completing again" +msgstr "" + msgid "" "partially complete command names (stop when many commands found begin with " "same letters)" @@ -7228,15 +7232,12 @@ msgstr "Maus ist inaktiv" msgid " TERM='%s', size: %dx%d" msgstr " TERM='%s', Größe: %dx%d" -#, c-format msgid "Running WeeChat in background..." msgstr "WeeChat wird im Hintergrund ausgeführt..." -#, c-format msgid "fork error" msgstr "Fork-Fehler" -#, c-format msgid "OK" msgstr "OK" @@ -7837,8 +7838,8 @@ msgstr "" msgid " - ${number_zero2}: like ${number2} but the number is zero-padded" msgstr "" -" - ${number_zero2}: wie ${number2}, aber die Zahl wird mit Nullen" -" aufgefüllt" +" - ${number_zero2}: wie ${number2}, aber die Zahl wird mit Nullen " +"aufgefüllt" msgid "" " - ${number_displayed}: \"1\" if the number is displayed, otherwise \"0\"" @@ -18963,4 +18964,3 @@ msgstr "" "%s%s Datei \"%s\" zum Fortsetzen der Übertragung wird nicht akzeptiert " "(Port: %d, Startposition: %llu): xfer nicht gefunden oder nicht bereit für " "Transfer" - diff --git a/po/es.po b/po/es.po index ea63f93f9..a4c4161d9 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-05-04 09:21+0200\n" +"POT-Creation-Date: 2025-06-30 09:32+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -5577,6 +5577,10 @@ msgstr "" msgid "send alert (BEL) when a partial completion occurs" msgstr "alertar al usuario cuando ocurre un completado parcial" +msgid "" +"automatically expand word after partial completion when completing again" +msgstr "" + msgid "" "partially complete command names (stop when many commands found begin with " "same letters)" @@ -6559,15 +6563,13 @@ msgstr "Ratón desactivado" msgid " TERM='%s', size: %dx%d" msgstr " TERM='%s', tamaño: %dx%d" -#, c-format msgid "Running WeeChat in background..." msgstr "" -#, fuzzy, c-format +#, fuzzy msgid "fork error" msgstr "error" -#, c-format msgid "OK" msgstr "OK" diff --git a/po/fr.po b/po/fr.po index 1641165f2..abd81d9ab 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-05-04 09:21+0200\n" -"PO-Revision-Date: 2025-05-04 09:24+0200\n" +"POT-Creation-Date: 2025-06-30 09:32+0200\n" +"PO-Revision-Date: 2025-06-30 09:34+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -6068,6 +6068,12 @@ msgstr "" msgid "send alert (BEL) when a partial completion occurs" msgstr "envoyer une alerte (BEL) lorsqu'une complétion partielle survient" +msgid "" +"automatically expand word after partial completion when completing again" +msgstr "" +"étendre automatiquement le mot après une complétion partielle lors d'une " +"nouvelle complétion" + msgid "" "partially complete command names (stop when many commands found begin with " "same letters)" @@ -7089,15 +7095,12 @@ msgstr "La souris est désactivée" msgid " TERM='%s', size: %dx%d" msgstr " TERM='%s', taille : %dx%d" -#, c-format msgid "Running WeeChat in background..." msgstr "Lancement de WeeChat en tâche de fond..." -#, c-format msgid "fork error" msgstr "erreur de fork" -#, c-format msgid "OK" msgstr "OK" diff --git a/po/hu.po b/po/hu.po index d211df988..11a3fbdb8 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-05-04 09:21+0200\n" +"POT-Creation-Date: 2025-06-30 09:32+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -5144,6 +5144,10 @@ msgstr "" msgid "send alert (BEL) when a partial completion occurs" msgstr "" +msgid "" +"automatically expand word after partial completion when completing again" +msgstr "" + msgid "" "partially complete command names (stop when many commands found begin with " "same letters)" @@ -6037,15 +6041,13 @@ msgstr "Nincs aliasz definiálva.\n" msgid " TERM='%s', size: %dx%d" msgstr "" -#, c-format msgid "Running WeeChat in background..." msgstr "" -#, fuzzy, c-format +#, fuzzy msgid "fork error" msgstr "%sSzerver: %s%s\n" -#, c-format msgid "OK" msgstr "Rendben" diff --git a/po/it.po b/po/it.po index 3c2029075..c6a437824 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-05-04 09:21+0200\n" +"POT-Creation-Date: 2025-06-30 09:32+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -5560,6 +5560,10 @@ msgstr "" msgid "send alert (BEL) when a partial completion occurs" msgstr "avvisa l'utente quando si verifica un completamento parziale" +msgid "" +"automatically expand word after partial completion when completing again" +msgstr "" + msgid "" "partially complete command names (stop when many commands found begin with " "same letters)" @@ -6497,15 +6501,13 @@ msgstr "Mouse disabilitato" msgid " TERM='%s', size: %dx%d" msgstr " TERM='%s', dimensione %dx%d" -#, c-format msgid "Running WeeChat in background..." msgstr "" -#, fuzzy, c-format +#, fuzzy msgid "fork error" msgstr "errore" -#, c-format msgid "OK" msgstr "OK" diff --git a/po/ja.po b/po/ja.po index bd620aaaf..4de59c2cb 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-05-04 09:21+0200\n" +"POT-Creation-Date: 2025-06-30 09:32+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" @@ -6037,6 +6037,10 @@ msgstr "" msgid "send alert (BEL) when a partial completion occurs" msgstr "wyślij alarm (BEL), kiedy nastąpi częściowe dopełnienie" +msgid "" +"automatically expand word after partial completion when completing again" +msgstr "" + msgid "" "partially complete command names (stop when many commands found begin with " "same letters)" @@ -7080,15 +7084,12 @@ msgstr "Obsługa myszy wyłączona" msgid " TERM='%s', size: %dx%d" msgstr " TERM='%s', rozmiar: %dx%d" -#, c-format msgid "Running WeeChat in background..." msgstr "Uruchamianie WeeChat w tle..." -#, c-format msgid "fork error" msgstr "nie udało się utworzyć procesu" -#, c-format msgid "OK" msgstr "OK" diff --git a/po/pt.po b/po/pt.po index b763d9413..f78381833 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-05-04 09:21+0200\n" +"POT-Creation-Date: 2025-06-30 09:32+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -5778,6 +5778,10 @@ msgstr "" msgid "send alert (BEL) when a partial completion occurs" msgstr "alertar o utilizador ao completar parcialmente" +msgid "" +"automatically expand word after partial completion when completing again" +msgstr "" + msgid "" "partially complete command names (stop when many commands found begin with " "same letters)" @@ -6754,15 +6758,13 @@ msgstr "O rato está desativado" msgid " TERM='%s', size: %dx%d" msgstr " TERM='%s', tamanho: %dx%d" -#, c-format msgid "Running WeeChat in background..." msgstr "" -#, fuzzy, c-format +#, fuzzy msgid "fork error" msgstr "erro" -#, c-format msgid "OK" msgstr "OK" diff --git a/po/pt_BR.po b/po/pt_BR.po index 80c1b2d01..629c23c6d 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-05-04 09:21+0200\n" +"POT-Creation-Date: 2025-06-30 09:32+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -5481,6 +5481,10 @@ msgstr "" msgid "send alert (BEL) when a partial completion occurs" msgstr "alertar usuário quando uma completação parcial ocorre" +msgid "" +"automatically expand word after partial completion when completing again" +msgstr "" + msgid "" "partially complete command names (stop when many commands found begin with " "same letters)" @@ -6404,15 +6408,13 @@ msgstr "Mouse está desabilitado" msgid " TERM='%s', size: %dx%d" msgstr " TERM='%s', tamanho: %dx%d" -#, c-format msgid "Running WeeChat in background..." msgstr "" -#, fuzzy, c-format +#, fuzzy msgid "fork error" msgstr "%s%s: erro: %s" -#, c-format msgid "OK" msgstr "OK" diff --git a/po/ru.po b/po/ru.po index defbd2e27..f5fe1f148 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-05-04 09:21+0200\n" +"POT-Creation-Date: 2025-06-30 09:32+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" @@ -5178,6 +5178,10 @@ msgstr "" msgid "send alert (BEL) when a partial completion occurs" msgstr "" +msgid "" +"automatically expand word after partial completion when completing again" +msgstr "" + msgid "" "partially complete command names (stop when many commands found begin with " "same letters)" @@ -6075,15 +6079,13 @@ msgstr "Сокращения не заданы.\n" msgid " TERM='%s', size: %dx%d" msgstr "" -#, c-format msgid "Running WeeChat in background..." msgstr "" -#, fuzzy, c-format +#, fuzzy msgid "fork error" msgstr "%sСервер: %s%s\n" -#, c-format msgid "OK" msgstr "OK" diff --git a/po/sr.po b/po/sr.po index fbace55e7..fe6ce7235 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-05-04 09:21+0200\n" +"POT-Creation-Date: 2025-06-30 09:32+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -5861,6 +5861,10 @@ msgstr "" msgid "send alert (BEL) when a partial completion occurs" msgstr "шаље упозорење (BEL) када се догоди делимично довршавање" +msgid "" +"automatically expand word after partial completion when completing again" +msgstr "" + msgid "" "partially complete command names (stop when many commands found begin with " "same letters)" @@ -6865,15 +6869,12 @@ msgstr "Миш је искључен" msgid " TERM='%s', size: %dx%d" msgstr " TERM=’%s’, величина: %dx%d" -#, c-format msgid "Running WeeChat in background..." msgstr "WeeChat се извршава у позадини..." -#, c-format msgid "fork error" msgstr "грешка при рачвању" -#, c-format msgid "OK" msgstr "ОК" diff --git a/po/tr.po b/po/tr.po index 35f257451..a7e07c35d 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-05-04 09:21+0200\n" +"POT-Creation-Date: 2025-06-30 09:32+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -5734,6 +5734,10 @@ msgstr "" msgid "send alert (BEL) when a partial completion occurs" msgstr "kısmi bir tamamlama gerçekleştiğinde uyarı (BEL) gönder" +msgid "" +"automatically expand word after partial completion when completing again" +msgstr "" + msgid "" "partially complete command names (stop when many commands found begin with " "same letters)" @@ -6757,15 +6761,12 @@ msgstr "Fare devre dışı" msgid " TERM='%s', size: %dx%d" msgstr " TERM='%s', boyut: %dx%d" -#, c-format msgid "Running WeeChat in background..." msgstr "WeeChat arka planda çalışıyor..." -#, c-format msgid "fork error" msgstr "çatal hatası" -#, c-format msgid "OK" msgstr "TAMAM" diff --git a/po/weechat.pot b/po/weechat.pot index da69636cb..842f9d9be 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-05-04 09:21+0200\n" +"POT-Creation-Date: 2025-06-30 09:32+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -4804,6 +4804,10 @@ msgstr "" msgid "send alert (BEL) when a partial completion occurs" msgstr "" +msgid "" +"automatically expand word after partial completion when completing again" +msgstr "" + msgid "" "partially complete command names (stop when many commands found begin with " "same letters)" @@ -5622,15 +5626,12 @@ msgstr "" msgid " TERM='%s', size: %dx%d" msgstr "" -#, c-format msgid "Running WeeChat in background..." msgstr "" -#, c-format msgid "fork error" msgstr "" -#, c-format msgid "OK" msgstr "" diff --git a/src/core/core-config.c b/src/core/core-config.c index 69b5e03b3..2659fed92 100644 --- a/src/core/core-config.c +++ b/src/core/core-config.c @@ -313,6 +313,7 @@ struct t_config_option *config_completion_nick_first_only = NULL; struct t_config_option *config_completion_nick_ignore_chars = NULL; struct t_config_option *config_completion_nick_ignore_words = NULL; struct t_config_option *config_completion_partial_completion_alert = NULL; +struct t_config_option *config_completion_partial_completion_auto_expand = NULL; struct t_config_option *config_completion_partial_completion_command = NULL; struct t_config_option *config_completion_partial_completion_command_arg = NULL; struct t_config_option *config_completion_partial_completion_count = NULL; @@ -5243,6 +5244,13 @@ config_weechat_init_options (void) N_("send alert (BEL) when a partial completion occurs"), NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_partial_completion_auto_expand = config_file_new_option ( + weechat_config_file, weechat_config_section_completion, + "partial_completion_auto_expand", "boolean", + N_("automatically expand word after partial completion when " + "completing again"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_partial_completion_command = config_file_new_option ( weechat_config_file, weechat_config_section_completion, "partial_completion_command", "boolean", diff --git a/src/core/core-config.h b/src/core/core-config.h index 98e8d32d0..7be289a26 100644 --- a/src/core/core-config.h +++ b/src/core/core-config.h @@ -362,6 +362,7 @@ extern struct t_config_option *config_completion_nick_first_only; extern struct t_config_option *config_completion_nick_ignore_chars; extern struct t_config_option *config_completion_nick_ignore_words; extern struct t_config_option *config_completion_partial_completion_alert; +extern struct t_config_option *config_completion_partial_completion_auto_expand; extern struct t_config_option *config_completion_partial_completion_command; extern struct t_config_option *config_completion_partial_completion_command_arg; extern struct t_config_option *config_completion_partial_completion_count; diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c index 97536fc50..effc39136 100644 --- a/src/gui/gui-completion.c +++ b/src/gui/gui-completion.c @@ -1502,7 +1502,7 @@ gui_completion_search (struct t_gui_completion *completion, const char *data, int position, int direction) { char *old_word_found; - int real_position; + int real_position, force_no_partial; if (!completion || !data || (position < 0)) return 0; @@ -1511,6 +1511,15 @@ gui_completion_search (struct t_gui_completion *completion, const char *data, completion->direction = direction; + force_no_partial = 0; + if ((completion->context != GUI_COMPLETION_NULL) + && (arraylist_size (completion->partial_list) > 0) + && CONFIG_BOOLEAN(config_completion_partial_completion_auto_expand)) + { + force_no_partial = 1; + arraylist_clear (completion->partial_list); + } + /* if new completion => look for base word */ if (real_position != completion->position) { @@ -1522,7 +1531,12 @@ gui_completion_search (struct t_gui_completion *completion, const char *data, completion->partial_completion = (direction < 0); completion->direction = direction; gui_completion_find_context (completion, data, real_position); - if (completion->template_partial_completion) + if (force_no_partial) + { + completion->partial_completion = 0; + completion->direction = 1; + } + else if (completion->template_partial_completion) { if (completion->direction < 0) {