1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Sébastien Helleu d67520a212 core: add option weechat.completion.partial_completion_auto_expand (closes #2253) 2025-06-30 09:35:53 +02:00
Sébastien Helleu b467f85f30 core: always enable partial completion for templates in option weechat.completion.partial_completion_templates (issue #2253)
Previous behavior was to reverse the partial completion, which was confusing
when option like weechat.completion.partial_completion_command_arg was enabled
as well.
2025-06-29 14:24:58 +02:00
19 changed files with 168 additions and 96 deletions
+1
View File
@@ -13,6 +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, 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 <plugin>`
### Added
+6 -4
View File
@@ -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 <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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"
+7 -7
View File
@@ -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 <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\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"
+6 -4
View File
@@ -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 <santiago@forero.xyz>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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"
+8 -5
View File
@@ -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 <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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"
+6 -4
View File
@@ -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 <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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"
+6 -4
View File
@@ -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 <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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"
+5 -4
View File
@@ -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 <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -5740,6 +5740,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)"
@@ -6712,15 +6716,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 "成功"
+5 -4
View File
@@ -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: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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"
+6 -4
View File
@@ -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 <vascomalmeida@sapo.pt>\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"
+6 -4
View File
@@ -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 <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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"
+6 -4
View File
@@ -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 <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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"
+5 -4
View File
@@ -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ć <ivan.pesic@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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 "ОК"
+5 -4
View File
@@ -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 <emir_sari@icloud.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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"
+5 -4
View File
@@ -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 <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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 ""
+8
View File
@@ -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",
+1
View File
@@ -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;
+74 -34
View File
@@ -127,8 +127,8 @@ gui_completion_init (struct t_gui_completion *completion,
completion->args = NULL;
completion->direction = 0;
completion->add_space = 1;
completion->force_partial_completion = 0;
completion->reverse_partial_completion = 0;
completion->partial_completion = 0;
completion->template_partial_completion = 0;
completion->list = arraylist_new (
32, 1, 0,
@@ -631,7 +631,7 @@ gui_completion_build_list_template (struct t_gui_completion *completion,
config_hashtable_completion_partial_templates,
custom_completion))
{
completion->reverse_partial_completion = 1;
completion->template_partial_completion = 1;
}
gui_completion_custom (completion,
custom_completion,
@@ -907,8 +907,6 @@ gui_completion_find_context (struct t_gui_completion *completion,
const char *ptr_command, *ptr_data, *ptr_space, *ptr_newline, *prev_char;
/* look for context */
gui_completion_free_data (completion);
gui_completion_init (completion, completion->plugin, completion->buffer);
ptr_command = NULL;
command_arg = 0;
@@ -1241,7 +1239,7 @@ gui_completion_partial_build_list (struct t_gui_completion *completion,
void
gui_completion_complete (struct t_gui_completion *completion)
{
int length, word_found_seen, other_completion, partial_completion;
int length, word_found_seen, other_completion;
int common_prefix_size, index, index2;
struct t_gui_completion_word *ptr_completion_word, *ptr_completion_word2;
@@ -1249,34 +1247,15 @@ gui_completion_complete (struct t_gui_completion *completion)
word_found_seen = 0;
other_completion = 0;
partial_completion = completion->force_partial_completion;
if (!partial_completion)
{
if (completion->context == GUI_COMPLETION_COMMAND)
{
partial_completion = CONFIG_BOOLEAN(config_completion_partial_completion_command);
}
else if (completion->context == GUI_COMPLETION_COMMAND_ARG)
{
partial_completion = CONFIG_BOOLEAN(config_completion_partial_completion_command_arg);
}
else
partial_completion = CONFIG_BOOLEAN(config_completion_partial_completion_other);
}
if (completion->reverse_partial_completion)
partial_completion ^= 1;
common_prefix_size = 0;
if (partial_completion
if (completion->partial_completion
&& completion->list && (completion->list->size > 0))
{
common_prefix_size = gui_completion_common_prefix_size (completion->list,
NULL);
}
if (partial_completion
if (completion->partial_completion
&& completion->word_found
&& (utf8_strlen (completion->word_found) >= common_prefix_size))
{
@@ -1355,7 +1334,7 @@ gui_completion_complete (struct t_gui_completion *completion)
completion->position = 0;
/* stop after common prefix, if asked by user */
if (partial_completion
if (completion->partial_completion
&& ((utf8_strlen (completion->word_found) >= common_prefix_size))
&& (other_completion > 0))
{
@@ -1523,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;
@@ -1532,14 +1511,75 @@ 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)
{
free (completion->word_found);
completion->word_found = NULL;
completion->word_found_is_nick = 0;
gui_completion_free_data (completion);
gui_completion_init (completion, completion->plugin, completion->buffer);
completion->partial_completion = (direction < 0);
completion->direction = direction;
gui_completion_find_context (completion, data, real_position);
completion->force_partial_completion = (direction < 0);
if (force_no_partial)
{
completion->partial_completion = 0;
completion->direction = 1;
}
else if (completion->template_partial_completion)
{
if (completion->direction < 0)
{
completion->partial_completion = 0;
completion->direction = 1;
}
else
{
completion->partial_completion = 1;
}
}
else
{
switch (completion->context)
{
case GUI_COMPLETION_NULL:
break;
case GUI_COMPLETION_COMMAND:
if (CONFIG_BOOLEAN(config_completion_partial_completion_command))
{
completion->partial_completion ^= 1;
if (completion->direction < 0)
completion->direction = 1;
}
break;
case GUI_COMPLETION_COMMAND_ARG:
if (CONFIG_BOOLEAN(config_completion_partial_completion_command_arg))
{
completion->partial_completion ^= 1;
if (completion->direction < 0)
completion->direction = 1;
}
break;
case GUI_COMPLETION_AUTO:
if (CONFIG_BOOLEAN(config_completion_partial_completion_other))
{
completion->partial_completion ^= 1;
if (completion->direction < 0)
completion->direction = 1;
}
break;
}
}
}
/* completion */
@@ -1656,8 +1696,8 @@ gui_completion_hdata_completion_cb (const void *pointer, void *data,
HDATA_VAR(struct t_gui_completion, args, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_gui_completion, direction, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_completion, add_space, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_completion, force_partial_completion, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_completion, reverse_partial_completion, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_completion, partial_completion, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_completion, template_partial_completion, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_completion, list, POINTER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_completion, word_found, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_gui_completion, word_found_is_nick, INTEGER, 0, NULL, NULL);
@@ -1745,8 +1785,8 @@ gui_completion_print_log (void)
log_printf (" args. . . . . . . . . . . : '%s'", ptr_completion->args);
log_printf (" direction . . . . . . . . : %d", ptr_completion->direction);
log_printf (" add_space . . . . . . . . : %d", ptr_completion->add_space);
log_printf (" force_partial_completion. : %d", ptr_completion->force_partial_completion);
log_printf (" reverse_partial_completion: %d", ptr_completion->reverse_partial_completion);
log_printf (" partial_completion. . . . : %d", ptr_completion->partial_completion);
log_printf (" template_partial_completion: %d", ptr_completion->template_partial_completion);
log_printf (" list. . . . . . . . . . . : %p", ptr_completion->list);
log_printf (" word_found. . . . . . . . : '%s'", ptr_completion->word_found);
log_printf (" word_found_is_nick. . . . : %d", ptr_completion->word_found_is_nick);
+2 -2
View File
@@ -56,8 +56,8 @@ struct t_gui_completion
char *args; /* command line args (including base word) */
int direction; /* +1=search next word, -1=previous word */
int add_space; /* add space after completion? */
int force_partial_completion; /* force partial completion? */
int reverse_partial_completion; /* reverse partial completion? */
int partial_completion; /* partial completion? */
int template_partial_completion; /* template with partial completion? */
/* for command argument completion */
struct t_arraylist *list; /* data list for completion */