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

Fix bug with partial completions

Option "weechat.completion.partial_completion_nick" has been renamed to
"weechat.completion.partial_completion_other".
This commit is contained in:
Sebastien Helleu
2009-04-01 23:30:57 +02:00
parent ff83985ef4
commit ca7bcf880b
14 changed files with 92 additions and 100 deletions
+1 -1
View File
@@ -646,7 +646,7 @@
</listitem>
</itemizedlist>
<command>weechat.completion.partial_completion_nick</command>: partially complete nicks (stop when many nicks found begin with same letters)
<command>weechat.completion.partial_completion_other</command>: partially complete outside commands (stop when many words found begin with same letters)
<itemizedlist>
<listitem>
<para>type: boolean</para>
+1 -1
View File
@@ -646,7 +646,7 @@
</listitem>
</itemizedlist>
<command>weechat.completion.partial_completion_nick</command>: partially complete nicks (stop when many nicks found begin with same letters)
<command>weechat.completion.partial_completion_other</command>: partially complete outside commands (stop when many words found begin with same letters)
<itemizedlist>
<listitem>
<para>type: boolean</para>
+2 -2
View File
@@ -566,7 +566,7 @@
</listitem>
</itemizedlist>
<command>weechat.completion.default_template</command>: modèle de complétion par défaut (merci de consulter la documentation pour les codes et valeurs pour le modèle)
<command>weechat.completion.default_template</command>: modèle de complétion par défaut (merci de consulter la documentation pour les codes et valeurs du modèle)
<itemizedlist>
<listitem>
<para>type: chaîne</para>
@@ -646,7 +646,7 @@
</listitem>
</itemizedlist>
<command>weechat.completion.partial_completion_nick</command>: complète partiellement les pseudos (stoppe quand plusieurs pseudos trouvés commencent par les mêmes lettres)
<command>weechat.completion.partial_completion_other</command>: complète partiellement en dehors des commandes (stoppe quand plusieurs mots trouvés commencent par les mêmes lettres)
<itemizedlist>
<listitem>
<para>type: booléen</para>
+16 -7
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2009-04-01 18:45+0200\n"
"POT-Creation-Date: 2009-04-01 22:41+0200\n"
"PO-Revision-Date: 2009-01-03 00:42+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1637,12 +1637,6 @@ msgstr "znaky ignorovány pro doplňování přezdívky"
msgid "alert user when a partial completion occurs"
msgstr "upozornit uživatele pokud nastane částečné doplnění"
msgid ""
"partially complete nicks (stop when many nicks found begin with same letters)"
msgstr ""
"částečně doplňovat přezdívky (zastavit pokud je nalezeno více přezdívek "
"začínajících stejnými písmenemy)"
msgid ""
"partially complete command names (stop when many commands found begin with "
"same letters)"
@@ -1657,6 +1651,14 @@ msgstr ""
"částečně doplňovat argumenty příkazů (zastavit pokud je nalezeno více "
"argumentů začínající stejným prefixem)"
#, fuzzy
msgid ""
"partially complete outside commands (stop when many words found begin with "
"same letters)"
msgstr ""
"částečně doplňovat jména příkazů (zastavit pokud je nalezeno více příkazů "
"začínajících stejnými písmeny)"
msgid "display count for each partial completion in bar item"
msgstr "zobrazit počet každého částečného doplnění v položce pole"
@@ -5556,6 +5558,13 @@ msgstr "%s DCC: nemohu nastavit 'neblokovaci' volbu na soket\n"
msgid "%s%s: timeout for \"%s\" with %s"
msgstr "%s chybí argument pro volbu \"%s\"\n"
#~ msgid ""
#~ "partially complete nicks (stop when many nicks found begin with same "
#~ "letters)"
#~ msgstr ""
#~ "částečně doplňovat přezdívky (zastavit pokud je nalezeno více přezdívek "
#~ "začínajících stejnými písmenemy)"
#~ msgid "[action [args] | number | [[server] [channel]]]"
#~ msgstr "[akce [args] | číslo | [[server] [kanál]]]"
+6 -5
View File
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2009-04-01 18:45+0200\n"
"POT-Creation-Date: 2009-04-01 22:41+0200\n"
"PO-Revision-Date: 2009-01-03 00:42+0100\n"
"Last-Translator: Thomas Schuetz <i18n@internet-villa.de>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1663,10 +1663,6 @@ msgstr "Zeichen, die bei der Nickvervollständigung ignoriert werden"
msgid "alert user when a partial completion occurs"
msgstr ""
msgid ""
"partially complete nicks (stop when many nicks found begin with same letters)"
msgstr ""
msgid ""
"partially complete command names (stop when many commands found begin with "
"same letters)"
@@ -1677,6 +1673,11 @@ msgid ""
"with same prefix)"
msgstr ""
msgid ""
"partially complete outside commands (stop when many words found begin with "
"same letters)"
msgstr ""
msgid "display count for each partial completion in bar item"
msgstr ""
+6 -5
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2009-04-01 18:45+0200\n"
"POT-Creation-Date: 2009-04-01 22:41+0200\n"
"PO-Revision-Date: 2009-01-03 00:42+0100\n"
"Last-Translator: Roberto González Cardenete <robert.glez@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1644,10 +1644,6 @@ msgstr "caracteres ignorados para el completado del nombre de usuario"
msgid "alert user when a partial completion occurs"
msgstr ""
msgid ""
"partially complete nicks (stop when many nicks found begin with same letters)"
msgstr ""
msgid ""
"partially complete command names (stop when many commands found begin with "
"same letters)"
@@ -1658,6 +1654,11 @@ msgid ""
"with same prefix)"
msgstr ""
msgid ""
"partially complete outside commands (stop when many words found begin with "
"same letters)"
msgstr ""
msgid "display count for each partial completion in bar item"
msgstr ""
+16 -8
View File
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2009-04-01 18:45+0200\n"
"PO-Revision-Date: 2009-04-01 18:53+0200\n"
"POT-Creation-Date: 2009-04-01 22:41+0200\n"
"PO-Revision-Date: 2009-04-01 22:42+0200\n"
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"MIME-Version: 1.0\n"
@@ -1730,12 +1730,6 @@ msgstr "caractères à ignorer pour la complétion des pseudos"
msgid "alert user when a partial completion occurs"
msgstr "alterte de l'utilisateur lorsqu'une complétion partielle survient"
msgid ""
"partially complete nicks (stop when many nicks found begin with same letters)"
msgstr ""
"complète partiellement les pseudos (stoppe quand plusieurs pseudos trouvés "
"commencent par les mêmes lettres)"
msgid ""
"partially complete command names (stop when many commands found begin with "
"same letters)"
@@ -1750,6 +1744,13 @@ msgstr ""
"complète partiellement les paramètres de commande (stoppe quand plusieurs "
"paramètres trouvés commencent par les mêmes lettres)"
msgid ""
"partially complete outside commands (stop when many words found begin with "
"same letters)"
msgstr ""
"complète partiellement en dehors des commandes (stoppe quand plusieurs mots "
"trouvés commencent par les mêmes lettres)"
msgid "display count for each partial completion in bar item"
msgstr ""
"afficher le compteur pour chaque complétion partielle dans l'objet de barre"
@@ -5678,5 +5679,12 @@ msgstr "%s%s: impossible de positionner l'option \"nonblock\" pour la socket"
msgid "%s%s: timeout for \"%s\" with %s"
msgstr "%s%s: délai d'attente dépassé pour \"%s\" avec %s"
#~ msgid ""
#~ "partially complete nicks (stop when many nicks found begin with same "
#~ "letters)"
#~ msgstr ""
#~ "complète partiellement les pseudos (stoppe quand plusieurs pseudos "
#~ "trouvés commencent par les mêmes lettres)"
#~ msgid "[action [args] | number | [[server] [channel]]]"
#~ msgstr "[action [args] | nombre | [[serveur] [canal]]]"
+6 -5
View File
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2009-04-01 18:45+0200\n"
"POT-Creation-Date: 2009-04-01 22:41+0200\n"
"PO-Revision-Date: 2009-01-03 00:42+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1672,10 +1672,6 @@ msgstr "névkiegészítéskor mellőzött karakterek"
msgid "alert user when a partial completion occurs"
msgstr ""
msgid ""
"partially complete nicks (stop when many nicks found begin with same letters)"
msgstr ""
msgid ""
"partially complete command names (stop when many commands found begin with "
"same letters)"
@@ -1686,6 +1682,11 @@ msgid ""
"with same prefix)"
msgstr ""
msgid ""
"partially complete outside commands (stop when many words found begin with "
"same letters)"
msgstr ""
msgid "display count for each partial completion in bar item"
msgstr ""
+6 -5
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2009-04-01 18:45+0200\n"
"POT-Creation-Date: 2009-04-01 22:41+0200\n"
"PO-Revision-Date: 2009-01-03 00:42+0100\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1675,10 +1675,6 @@ msgstr "символы, игнорируемые при автодополнен
msgid "alert user when a partial completion occurs"
msgstr ""
msgid ""
"partially complete nicks (stop when many nicks found begin with same letters)"
msgstr ""
msgid ""
"partially complete command names (stop when many commands found begin with "
"same letters)"
@@ -1689,6 +1685,11 @@ msgid ""
"with same prefix)"
msgstr ""
msgid ""
"partially complete outside commands (stop when many words found begin with "
"same letters)"
msgstr ""
msgid "display count for each partial completion in bar item"
msgstr ""
+6 -5
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2009-04-01 18:45+0200\n"
"POT-Creation-Date: 2009-04-01 22:41+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1402,10 +1402,6 @@ msgstr ""
msgid "alert user when a partial completion occurs"
msgstr ""
msgid ""
"partially complete nicks (stop when many nicks found begin with same letters)"
msgstr ""
msgid ""
"partially complete command names (stop when many commands found begin with "
"same letters)"
@@ -1416,6 +1412,11 @@ msgid ""
"with same prefix)"
msgstr ""
msgid ""
"partially complete outside commands (stop when many words found begin with "
"same letters)"
msgstr ""
msgid "display count for each partial completion in bar item"
msgstr ""
+7 -7
View File
@@ -149,9 +149,9 @@ struct t_config_option *config_completion_nick_completor;
struct t_config_option *config_completion_nick_first_only;
struct t_config_option *config_completion_nick_ignore_chars;
struct t_config_option *config_completion_partial_completion_alert;
struct t_config_option *config_completion_partial_completion_nick;
struct t_config_option *config_completion_partial_completion_command;
struct t_config_option *config_completion_partial_completion_command_arg;
struct t_config_option *config_completion_partial_completion_other;
struct t_config_option *config_completion_partial_completion_count;
/* config, history section */
@@ -1625,12 +1625,6 @@ config_weechat_init_options ()
"partial_completion_alert", "boolean",
N_("alert user when a partial completion occurs"),
NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_partial_completion_nick = config_file_new_option (
weechat_config_file, ptr_section,
"partial_completion_nick", "boolean",
N_("partially complete nicks (stop when many nicks found begin with "
"same letters)"),
NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_partial_completion_command = config_file_new_option (
weechat_config_file, ptr_section,
"partial_completion_command", "boolean",
@@ -1643,6 +1637,12 @@ config_weechat_init_options ()
N_("partially complete command arguments (stop when many arguments "
"found begin with same prefix)"),
NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_partial_completion_other = config_file_new_option (
weechat_config_file, ptr_section,
"partial_completion_other", "boolean",
N_("partially complete outside commands (stop when many words found "
"begin with same letters)"),
NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_partial_completion_count = config_file_new_option (
weechat_config_file, ptr_section,
"partial_completion_count", "boolean",
+1 -1
View File
@@ -151,9 +151,9 @@ extern struct t_config_option *config_completion_nick_completor;
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_partial_completion_alert;
extern struct t_config_option *config_completion_partial_completion_nick;
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_other;
extern struct t_config_option *config_completion_partial_completion_count;
extern struct t_config_option *config_history_max_lines;
+15 -43
View File
@@ -65,7 +65,6 @@ gui_completion_init (struct t_gui_completion *completion,
completion->context = GUI_COMPLETION_NULL;
completion->base_command = NULL;
completion->base_command_arg = 0;
completion->arg_is_nick = 0;
completion->base_word = NULL;
completion->base_word_pos = 0;
completion->position = -1;
@@ -605,8 +604,6 @@ gui_completion_list_add_nicks (struct t_gui_completion *completion)
&ptr_group, &ptr_nick);
}
}
completion->arg_is_nick = 1;
}
/*
@@ -1430,8 +1427,7 @@ gui_completion_partial_build_list (struct t_gui_completion *completion,
*/
void
gui_completion_complete (struct t_gui_completion *completion,
int nick_completion)
gui_completion_complete (struct t_gui_completion *completion)
{
int length, word_found_seen, other_completion, partial_completion;
int common_prefix_size, item_is_nick;
@@ -1442,26 +1438,21 @@ gui_completion_complete (struct t_gui_completion *completion,
other_completion = 0;
partial_completion = completion->force_partial_completion;
if (!partial_completion)
{
if (nick_completion)
if (completion->context == GUI_COMPLETION_COMMAND)
{
partial_completion = CONFIG_BOOLEAN(config_completion_partial_completion_nick);
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
{
if (completion->context == GUI_COMPLETION_COMMAND)
{
partial_completion = CONFIG_BOOLEAN(config_completion_partial_completion_command);
}
else
{
partial_completion = CONFIG_BOOLEAN(config_completion_partial_completion_command_arg);
}
}
partial_completion = CONFIG_BOOLEAN(config_completion_partial_completion_other);
}
common_prefix_size = 0;
if (partial_completion
&& completion->completion_list && completion->completion_list->items)
@@ -1585,7 +1576,7 @@ gui_completion_complete (struct t_gui_completion *completion,
free (completion->word_found);
completion->word_found = NULL;
completion->word_found_is_nick = 0;
gui_completion_complete (completion, nick_completion);
gui_completion_complete (completion);
}
}
@@ -1614,22 +1605,7 @@ gui_completion_command (struct t_gui_completion *completion)
}
}
gui_completion_complete (completion, 0);
}
/*
* gui_completion_nick: complete a nick
*/
void
gui_completion_nick (struct t_gui_completion *completion)
{
if (!completion->completion_list->items)
gui_completion_list_add_nicks (completion);
completion->context = GUI_COMPLETION_NICK;
gui_completion_complete (completion, 1);
gui_completion_complete (completion);
}
/*
@@ -1645,7 +1621,7 @@ gui_completion_auto (struct t_gui_completion *completion)
{
if (!completion->completion_list->items)
gui_completion_list_add_filename (completion);
gui_completion_complete (completion, 0);
gui_completion_complete (completion);
return;
}
@@ -1656,7 +1632,7 @@ gui_completion_auto (struct t_gui_completion *completion)
CONFIG_STRING(config_completion_default_template),
NULL);
}
gui_completion_complete (completion, 0);
gui_completion_complete (completion);
}
/*
@@ -1690,15 +1666,12 @@ gui_completion_search (struct t_gui_completion *completion, int direction,
case GUI_COMPLETION_NULL:
/* should never be executed */
return;
case GUI_COMPLETION_NICK:
gui_completion_nick (completion);
break;
case GUI_COMPLETION_COMMAND:
gui_completion_command (completion);
break;
case GUI_COMPLETION_COMMAND_ARG:
if (completion->completion_list->items)
gui_completion_complete (completion, completion->arg_is_nick);
gui_completion_complete (completion);
else
{
completion->context = GUI_COMPLETION_AUTO;
@@ -1742,7 +1715,6 @@ gui_completion_print_log (struct t_gui_completion *completion)
log_printf (" context . . . . . . . . : %d", completion->context);
log_printf (" base_command. . . . . . : '%s'", completion->base_command);
log_printf (" base_command_arg. . . . : %d", completion->base_command_arg);
log_printf (" arg_is_nick . . . . . . : %d", completion->arg_is_nick);
log_printf (" base_word . . . . . . . : '%s'", completion->base_word);
log_printf (" base_word_pos . . . . . : %d", completion->base_word_pos);
log_printf (" position. . . . . . . . : %d", completion->position);
+3 -5
View File
@@ -21,10 +21,9 @@
#define __WEECHAT_GUI_COMPLETION_H 1
#define GUI_COMPLETION_NULL 0
#define GUI_COMPLETION_NICK 1
#define GUI_COMPLETION_COMMAND 2
#define GUI_COMPLETION_COMMAND_ARG 3
#define GUI_COMPLETION_AUTO 4
#define GUI_COMPLETION_COMMAND 1
#define GUI_COMPLETION_COMMAND_ARG 2
#define GUI_COMPLETION_AUTO 3
struct t_gui_completion
{
@@ -33,7 +32,6 @@ struct t_gui_completion
int context; /* context: null, nick, command, cmd arg */
char *base_command; /* cmd with arg to complete (can be NULL) */
int base_command_arg; /* # arg to complete (if context=cmd arg) */
int arg_is_nick; /* argument is nick */
char *base_word; /* word to complete (when Tab was pressed) */
int base_word_pos; /* beggining of base word */
int position; /* position where Tab was pressed */