mirror of
https://github.com/weechat/weechat.git
synced 2026-06-30 06:46:38 +02:00
Add default template completion (by default: nick or IRC channel)
This commit is contained in:
@@ -566,6 +566,16 @@
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<command>weechat.completion.default_template</command>: default completion template (please see documentation for template codes and values)
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>type: string</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>values: any string (default value: '%n|%(irc_channels)')</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<command>weechat.completion.nick_completor</command>: string inserted after nick completion
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
|
||||
@@ -2040,7 +2040,8 @@ struct t_weelist *weechat_list_new ();
|
||||
struct t_weelist_item *weechat_list_add (
|
||||
struct t_weelist *weelist,
|
||||
const char *data,
|
||||
const char *where);
|
||||
const char *where,
|
||||
void *user_data);
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
@@ -2066,6 +2067,11 @@ struct t_weelist_item *weechat_list_add (
|
||||
WEECHAT_LIST_POS_END)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>user_data</option>: any pointer
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
@@ -2073,7 +2079,7 @@ struct t_weelist_item *weechat_list_add (
|
||||
</para>
|
||||
<para>
|
||||
Example:
|
||||
<screen>weechat_list_add (list, "my data", WEECHAT_LIST_POS_SORT);</screen>
|
||||
<screen>weechat_list_add (list, "my data", WEECHAT_LIST_POS_SORT, NULL);</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -566,6 +566,16 @@
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<command>weechat.completion.default_template</command>: default completion template (please see documentation for template codes and values)
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>type: string</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>values: any string (default value: '%n|%(irc_channels)')</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<command>weechat.completion.nick_completor</command>: string inserted after nick completion
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
|
||||
@@ -2039,7 +2039,8 @@ struct t_weelist *weechat_list_new ();
|
||||
struct t_weelist_item *weechat_list_add (
|
||||
struct t_weelist *weelist,
|
||||
const char *data,
|
||||
const char *where);
|
||||
const char *where,
|
||||
void *user_data);
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
@@ -2065,6 +2066,11 @@ struct t_weelist_item *weechat_list_add (
|
||||
WEECHAT_LIST_POS_END)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>user_data</option>: any pointer
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
@@ -2072,7 +2078,7 @@ struct t_weelist_item *weechat_list_add (
|
||||
</para>
|
||||
<para>
|
||||
Example:
|
||||
<screen>weechat_list_add (list, "my data", WEECHAT_LIST_POS_SORT);</screen>
|
||||
<screen>weechat_list_add (list, "my data", WEECHAT_LIST_POS_SORT, NULL);</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -566,6 +566,16 @@
|
||||
</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)
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>type: chaîne</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>valeurs: toute chaîne (valeur par défaut: '%n|%(irc_channels)')</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<command>weechat.completion.nick_completor</command>: chaîne affichée après la complétion des pseudos
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
|
||||
@@ -2040,7 +2040,8 @@ struct t_weelist *weechat_list_new ();
|
||||
struct t_weelist_item *weechat_list_add (
|
||||
struct t_weelist *weelist,
|
||||
const char *data,
|
||||
const char *where);
|
||||
const char *where,
|
||||
void *user_data);
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
@@ -2066,6 +2067,11 @@ struct t_weelist_item *weechat_list_add (
|
||||
WEECHAT_LIST_POS_END)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<option>user_data</option>: un pointeur
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
@@ -2073,7 +2079,7 @@ struct t_weelist_item *weechat_list_add (
|
||||
</para>
|
||||
<para>
|
||||
Example:
|
||||
<screen>weechat_list_add (list, "my data", WEECHAT_LIST_POS_SORT);</screen>
|
||||
<screen>weechat_list_add (list, "my data", WEECHAT_LIST_POS_SORT, NULL);</screen>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -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-03-29 19:09+0200\n"
|
||||
"POT-Creation-Date: 2009-04-01 18:45+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"
|
||||
@@ -1619,6 +1619,11 @@ msgstr "barva pro '+' při procházení přezdívek"
|
||||
msgid "text color for nicklist separator"
|
||||
msgstr "barva děliče přezdívek"
|
||||
|
||||
msgid ""
|
||||
"default completion template (please see documentation for template codes and "
|
||||
"values)"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "string inserted after nick completion"
|
||||
msgstr "řetězec vložený za doplňování přezdívky"
|
||||
|
||||
@@ -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-03-29 19:09+0200\n"
|
||||
"POT-Creation-Date: 2009-04-01 18:45+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"
|
||||
@@ -1645,6 +1645,11 @@ msgstr "Farbe des '+' beim Scrolling von Nicknames"
|
||||
msgid "text color for nicklist separator"
|
||||
msgstr "Farbe der Nicknamefenster-Trennlinie"
|
||||
|
||||
msgid ""
|
||||
"default completion template (please see documentation for template codes and "
|
||||
"values)"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "string inserted after nick completion"
|
||||
msgstr "Nach Nickvervollständigung anzufügende Zeichenfolge"
|
||||
|
||||
@@ -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-03-29 19:09+0200\n"
|
||||
"POT-Creation-Date: 2009-04-01 18:45+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"
|
||||
@@ -1626,6 +1626,11 @@ msgstr "color para '+' al desplazar nicks"
|
||||
msgid "text color for nicklist separator"
|
||||
msgstr "color para el separador de alias"
|
||||
|
||||
msgid ""
|
||||
"default completion template (please see documentation for template codes and "
|
||||
"values)"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "string inserted after nick completion"
|
||||
msgstr "la cadena mostrada tras la finalización de los nombres de usuario"
|
||||
|
||||
@@ -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-03-29 19:09+0200\n"
|
||||
"PO-Revision-Date: 2009-03-29 19:09+0200\n"
|
||||
"POT-Creation-Date: 2009-04-01 18:45+0200\n"
|
||||
"PO-Revision-Date: 2009-04-01 18:53+0200\n"
|
||||
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -510,7 +510,7 @@ msgid " configuration options hooked:"
|
||||
msgstr " options de configuration accrochées:"
|
||||
|
||||
msgid " completions hooked:"
|
||||
msgstr " completions accrochées:"
|
||||
msgstr " complétions accrochées:"
|
||||
|
||||
msgid " modifiers hooked:"
|
||||
msgstr " modificateurs accrochés:"
|
||||
@@ -1711,6 +1711,13 @@ msgstr ""
|
||||
msgid "text color for nicklist separator"
|
||||
msgstr "couleur du texte pour le séparateur de la liste des pseudos"
|
||||
|
||||
msgid ""
|
||||
"default completion template (please see documentation for template codes and "
|
||||
"values)"
|
||||
msgstr ""
|
||||
"modèle de complétion par défaut (merci de consulter la documentation pour "
|
||||
"les codes et valeurs du modèle)"
|
||||
|
||||
msgid "string inserted after nick completion"
|
||||
msgstr "chaîne affichée après la complétion des pseudos"
|
||||
|
||||
|
||||
@@ -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-03-29 19:09+0200\n"
|
||||
"POT-Creation-Date: 2009-04-01 18:45+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"
|
||||
@@ -1654,6 +1654,11 @@ msgstr "a '+' jel színe névlista görgetésekor"
|
||||
msgid "text color for nicklist separator"
|
||||
msgstr "névelválasztó színe"
|
||||
|
||||
msgid ""
|
||||
"default completion template (please see documentation for template codes and "
|
||||
"values)"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "string inserted after nick completion"
|
||||
msgstr "névkiegészítés után beszúrt szöveg"
|
||||
|
||||
@@ -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-03-29 19:09+0200\n"
|
||||
"POT-Creation-Date: 2009-04-01 18:45+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"
|
||||
@@ -1657,6 +1657,11 @@ msgstr "цвет '+' при прокрутке ников"
|
||||
msgid "text color for nicklist separator"
|
||||
msgstr "цвет разделителя ников"
|
||||
|
||||
msgid ""
|
||||
"default completion template (please see documentation for template codes and "
|
||||
"values)"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "string inserted after nick completion"
|
||||
msgstr "строка, вставляемая после автодополнения ника"
|
||||
|
||||
+6
-1
@@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2009-03-29 19:09+0200\n"
|
||||
"POT-Creation-Date: 2009-04-01 18:45+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"
|
||||
@@ -1385,6 +1385,11 @@ msgstr ""
|
||||
msgid "text color for nicklist separator"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"default completion template (please see documentation for template codes and "
|
||||
"values)"
|
||||
msgstr ""
|
||||
|
||||
msgid "string inserted after nick completion"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -144,6 +144,7 @@ struct t_config_option *config_color_nicklist_separator;
|
||||
|
||||
/* config, completion section */
|
||||
|
||||
struct t_config_option *config_completion_default_template;
|
||||
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;
|
||||
@@ -1597,6 +1598,13 @@ config_weechat_init_options ()
|
||||
return 0;
|
||||
}
|
||||
|
||||
config_completion_default_template = config_file_new_option (
|
||||
weechat_config_file, ptr_section,
|
||||
"default_template", "string",
|
||||
N_("default completion template (please see documentation for template "
|
||||
"codes and values)"),
|
||||
NULL, 0, 0, "%n|%(irc_channels)", NULL, 0,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
config_completion_nick_completor = config_file_new_option (
|
||||
weechat_config_file, ptr_section,
|
||||
"nick_completor", "string",
|
||||
|
||||
@@ -146,6 +146,7 @@ extern struct t_config_option *config_color_nicklist_prefix5;
|
||||
extern struct t_config_option *config_color_nicklist_more;
|
||||
extern struct t_config_option *config_color_nicklist_separator;
|
||||
|
||||
extern struct t_config_option *config_completion_default_template;
|
||||
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;
|
||||
|
||||
+3
-1
@@ -139,7 +139,8 @@ weelist_insert (struct t_weelist *weelist, struct t_weelist_item *item,
|
||||
*/
|
||||
|
||||
struct t_weelist_item *
|
||||
weelist_add (struct t_weelist *weelist, const char *data, const char *where)
|
||||
weelist_add (struct t_weelist *weelist, const char *data, const char *where,
|
||||
void *user_data)
|
||||
{
|
||||
struct t_weelist_item *new_item;
|
||||
|
||||
@@ -150,6 +151,7 @@ weelist_add (struct t_weelist *weelist, const char *data, const char *where)
|
||||
if (new_item)
|
||||
{
|
||||
new_item->data = strdup (data);
|
||||
new_item->user_data = user_data;
|
||||
weelist_insert (weelist, new_item, where);
|
||||
weelist->size++;
|
||||
}
|
||||
|
||||
+3
-1
@@ -23,6 +23,7 @@
|
||||
struct t_weelist_item
|
||||
{
|
||||
char *data; /* item data */
|
||||
void *user_data; /* pointer to user data */
|
||||
struct t_weelist_item *prev_item; /* link to previous item */
|
||||
struct t_weelist_item *next_item; /* link to next item */
|
||||
};
|
||||
@@ -36,7 +37,8 @@ struct t_weelist
|
||||
|
||||
extern struct t_weelist *weelist_new ();
|
||||
extern struct t_weelist_item *weelist_add (struct t_weelist *weelist,
|
||||
const char *data, const char *where);
|
||||
const char *data, const char *where,
|
||||
void *user_data);
|
||||
extern struct t_weelist_item *weelist_search (struct t_weelist *weelist,
|
||||
const char *data);
|
||||
extern struct t_weelist_item *weelist_casesearch (struct t_weelist *weelist,
|
||||
|
||||
+23
-13
@@ -77,6 +77,7 @@ gui_completion_init (struct t_gui_completion *completion,
|
||||
completion->completion_list = weelist_new ();
|
||||
|
||||
completion->word_found = NULL;
|
||||
completion->word_found_is_nick = 0;
|
||||
completion->position_replace = 0;
|
||||
completion->diff_size = 0;
|
||||
completion->diff_length = 0;
|
||||
@@ -316,7 +317,8 @@ gui_completion_list_add (struct t_gui_completion *completion, const char *word,
|
||||
|| (!nick_completion && (string_strncasecmp (completion->base_word, word,
|
||||
strlen (completion->base_word)) == 0)))
|
||||
{
|
||||
weelist_add (completion->completion_list, word, where);
|
||||
weelist_add (completion->completion_list, word, where,
|
||||
(nick_completion) ? (void *)1 : (void *)0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1381,7 +1383,7 @@ gui_completion_partial_build_list (struct t_gui_completion *completion,
|
||||
ptr_item = ptr_item->next_item)
|
||||
{
|
||||
weelist_add (weelist_temp, ptr_item->data + common_prefix_size,
|
||||
WEECHAT_LIST_POS_END);
|
||||
WEECHAT_LIST_POS_END, NULL);
|
||||
}
|
||||
|
||||
while (weelist_temp->items)
|
||||
@@ -1432,7 +1434,7 @@ gui_completion_complete (struct t_gui_completion *completion,
|
||||
int nick_completion)
|
||||
{
|
||||
int length, word_found_seen, other_completion, partial_completion;
|
||||
int common_prefix_size;
|
||||
int common_prefix_size, item_is_nick;
|
||||
struct t_weelist_item *ptr_item, *ptr_item2;
|
||||
|
||||
length = strlen (completion->base_word);
|
||||
@@ -1482,10 +1484,11 @@ gui_completion_complete (struct t_gui_completion *completion,
|
||||
|
||||
while (ptr_item)
|
||||
{
|
||||
if ((nick_completion
|
||||
item_is_nick = ((int)(ptr_item->user_data) == 1);
|
||||
if ((item_is_nick
|
||||
&& (gui_completion_nickncmp (completion->base_word, ptr_item->data,
|
||||
length) == 0))
|
||||
|| ((!nick_completion)
|
||||
|| ((!item_is_nick)
|
||||
&& (string_strncasecmp (completion->base_word, ptr_item->data,
|
||||
length) == 0)))
|
||||
{
|
||||
@@ -1494,9 +1497,10 @@ gui_completion_complete (struct t_gui_completion *completion,
|
||||
if (completion->word_found)
|
||||
free (completion->word_found);
|
||||
completion->word_found = strdup (ptr_item->data);
|
||||
completion->word_found_is_nick = item_is_nick;
|
||||
|
||||
/* stop after first nick if user asked that */
|
||||
if (nick_completion
|
||||
if (item_is_nick
|
||||
&& CONFIG_BOOLEAN(config_completion_nick_first_only))
|
||||
{
|
||||
gui_completion_stop (completion, 1);
|
||||
@@ -1510,11 +1514,11 @@ gui_completion_complete (struct t_gui_completion *completion,
|
||||
|
||||
while (ptr_item2)
|
||||
{
|
||||
if ((nick_completion
|
||||
if ((item_is_nick
|
||||
&& (gui_completion_nickncmp (completion->base_word,
|
||||
ptr_item2->data,
|
||||
length) == 0))
|
||||
|| ((!nick_completion)
|
||||
|| ((!item_is_nick)
|
||||
&& (string_strncasecmp (completion->base_word,
|
||||
ptr_item2->data,
|
||||
length) == 0)))
|
||||
@@ -1540,6 +1544,7 @@ gui_completion_complete (struct t_gui_completion *completion,
|
||||
&& (other_completion > 0))
|
||||
{
|
||||
completion->word_found[common_prefix_size] = '\0';
|
||||
completion->word_found_is_nick = 0;
|
||||
completion->add_space = 0;
|
||||
completion->position = -1;
|
||||
string_tolower (completion->word_found);
|
||||
@@ -1579,6 +1584,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);
|
||||
}
|
||||
}
|
||||
@@ -1643,11 +1649,14 @@ gui_completion_auto (struct t_gui_completion *completion)
|
||||
return;
|
||||
}
|
||||
|
||||
/* default: nick completion (if there's a nicklist) */
|
||||
if (completion->buffer->nicklist_root)
|
||||
gui_completion_nick (completion);
|
||||
else
|
||||
completion->context = GUI_COMPLETION_NULL;
|
||||
/* use default template completion */
|
||||
if (!completion->completion_list->items)
|
||||
{
|
||||
gui_completion_build_list_template (completion,
|
||||
CONFIG_STRING(config_completion_default_template),
|
||||
NULL);
|
||||
}
|
||||
gui_completion_complete (completion, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1668,6 +1677,7 @@ gui_completion_search (struct t_gui_completion *completion, int direction,
|
||||
if (completion->word_found)
|
||||
free (completion->word_found);
|
||||
completion->word_found = NULL;
|
||||
completion->word_found_is_nick = 0;
|
||||
gui_completion_find_context (completion, data, size, pos);
|
||||
completion->force_partial_completion = (direction < 0);
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ struct t_gui_completion
|
||||
|
||||
/* completion found */
|
||||
char *word_found; /* word found (to replace base word) */
|
||||
int word_found_is_nick; /* word found is nick? */
|
||||
int position_replace; /* position where word has to be replaced */
|
||||
int diff_size; /* size difference (< 0 = char(s) deleted) */
|
||||
int diff_length; /* length difference (<= diff_size) */
|
||||
|
||||
+1
-1
@@ -365,7 +365,7 @@ gui_input_complete (struct t_gui_buffer *buffer)
|
||||
|
||||
/* add nick completor if position 0 and completing nick */
|
||||
if ((buffer->completion->base_word_pos == 0)
|
||||
&& (buffer->completion->context == GUI_COMPLETION_NICK))
|
||||
&& buffer->completion->word_found_is_nick)
|
||||
{
|
||||
if (buffer->completion->add_space)
|
||||
{
|
||||
|
||||
@@ -334,7 +334,7 @@ irc_channel_nick_speaking_add (struct t_irc_channel *channel,
|
||||
|
||||
/* add nick in list */
|
||||
weechat_list_add (channel->nicks_speaking[highlight], nick_name,
|
||||
WEECHAT_LIST_POS_END);
|
||||
WEECHAT_LIST_POS_END, NULL);
|
||||
|
||||
/* reduce list size if it's too big */
|
||||
size = weechat_list_size (channel->nicks_speaking[highlight]);
|
||||
|
||||
@@ -278,7 +278,7 @@ jabber_muc_buddy_speaking_add (struct t_jabber_muc *muc, const char *buddy_name,
|
||||
|
||||
/* add buddy in list */
|
||||
weechat_list_add (muc->buddies_speaking[highlight], buddy_name,
|
||||
WEECHAT_LIST_POS_END);
|
||||
WEECHAT_LIST_POS_END, NULL);
|
||||
|
||||
/* reduce list size if it's too big */
|
||||
size = weechat_list_size (muc->buddies_speaking[highlight]);
|
||||
|
||||
@@ -910,7 +910,7 @@ plugin_display_short_list ()
|
||||
ptr_plugin = ptr_plugin->next_plugin)
|
||||
{
|
||||
length += strlen (ptr_plugin->name) + 2;
|
||||
weelist_add (list, ptr_plugin->name, WEECHAT_LIST_POS_SORT);
|
||||
weelist_add (list, ptr_plugin->name, WEECHAT_LIST_POS_SORT, NULL);
|
||||
}
|
||||
length++;
|
||||
|
||||
|
||||
@@ -550,7 +550,7 @@ weechat_lua_api_list_new (lua_State *L)
|
||||
static int
|
||||
weechat_lua_api_list_add (lua_State *L)
|
||||
{
|
||||
const char *weelist, *data, *where;
|
||||
const char *weelist, *data, *where, *user_data;
|
||||
char *result;
|
||||
int n;
|
||||
|
||||
@@ -566,22 +566,25 @@ weechat_lua_api_list_add (lua_State *L)
|
||||
weelist = NULL;
|
||||
data = NULL;
|
||||
where = NULL;
|
||||
user_data = NULL;
|
||||
|
||||
n = lua_gettop (lua_current_interpreter);
|
||||
|
||||
if (n < 3)
|
||||
if (n < 4)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("list_add");
|
||||
LUA_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
weelist = lua_tostring (lua_current_interpreter, -3);
|
||||
data = lua_tostring (lua_current_interpreter, -2);
|
||||
where = lua_tostring (lua_current_interpreter, -1);
|
||||
weelist = lua_tostring (lua_current_interpreter, -4);
|
||||
data = lua_tostring (lua_current_interpreter, -3);
|
||||
where = lua_tostring (lua_current_interpreter, -2);
|
||||
user_data = lua_tostring (lua_current_interpreter, -1);
|
||||
|
||||
result = script_ptr2str (weechat_list_add (script_str2ptr (weelist),
|
||||
data,
|
||||
where));
|
||||
where,
|
||||
script_str2ptr (user_data)));
|
||||
|
||||
LUA_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
@@ -462,7 +462,7 @@ static XS (XS_weechat_api_list_new)
|
||||
|
||||
static XS (XS_weechat_api_list_add)
|
||||
{
|
||||
char *result, *weelist, *data, *where;
|
||||
char *result, *weelist, *data, *where, *user_data;
|
||||
dXSARGS;
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -474,7 +474,7 @@ static XS (XS_weechat_api_list_add)
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
if (items < 4)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("list_add");
|
||||
PERL_RETURN_EMPTY;
|
||||
@@ -483,9 +483,11 @@ static XS (XS_weechat_api_list_add)
|
||||
weelist = SvPV (ST (0), PL_na);
|
||||
data = SvPV (ST (1), PL_na);
|
||||
where = SvPV (ST (2), PL_na);
|
||||
user_data = SvPV (ST (3), PL_na);
|
||||
result = script_ptr2str (weechat_list_add (script_str2ptr (weelist),
|
||||
data,
|
||||
where));
|
||||
where,
|
||||
script_str2ptr (user_data)));
|
||||
|
||||
PERL_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
@@ -485,7 +485,7 @@ weechat_python_api_list_new (PyObject *self, PyObject *args)
|
||||
static PyObject *
|
||||
weechat_python_api_list_add (PyObject *self, PyObject *args)
|
||||
{
|
||||
char *weelist, *data, *where, *result;
|
||||
char *weelist, *data, *where, *user_data, *result;
|
||||
PyObject *object;
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -500,8 +500,9 @@ weechat_python_api_list_add (PyObject *self, PyObject *args)
|
||||
weelist = NULL;
|
||||
data = NULL;
|
||||
where = NULL;
|
||||
user_data = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple (args, "sss", &weelist, &data, &where))
|
||||
if (!PyArg_ParseTuple (args, "ssss", &weelist, &data, &where, &user_data))
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("list_add");
|
||||
PYTHON_RETURN_EMPTY;
|
||||
@@ -509,7 +510,8 @@ weechat_python_api_list_add (PyObject *self, PyObject *args)
|
||||
|
||||
result = script_ptr2str (weechat_list_add (script_str2ptr (weelist),
|
||||
data,
|
||||
where));
|
||||
where,
|
||||
script_str2ptr (user_data)));
|
||||
|
||||
PYTHON_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
@@ -556,9 +556,10 @@ weechat_ruby_api_list_new (VALUE class)
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
weechat_ruby_api_list_add (VALUE class, VALUE weelist, VALUE data, VALUE where)
|
||||
weechat_ruby_api_list_add (VALUE class, VALUE weelist, VALUE data, VALUE where,
|
||||
VALUE user_data)
|
||||
{
|
||||
char *c_weelist, *c_data, *c_where, *result;
|
||||
char *c_weelist, *c_data, *c_where, *c_user_data, *result;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) class;
|
||||
@@ -572,8 +573,9 @@ weechat_ruby_api_list_add (VALUE class, VALUE weelist, VALUE data, VALUE where)
|
||||
c_weelist = NULL;
|
||||
c_data = NULL;
|
||||
c_where = NULL;
|
||||
c_user_data = NULL;
|
||||
|
||||
if (NIL_P (weelist) || NIL_P (data) || NIL_P (where))
|
||||
if (NIL_P (weelist) || NIL_P (data) || NIL_P (where) || NIL_P (user_data))
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("list_add");
|
||||
RUBY_RETURN_EMPTY;
|
||||
@@ -582,14 +584,17 @@ weechat_ruby_api_list_add (VALUE class, VALUE weelist, VALUE data, VALUE where)
|
||||
Check_Type (weelist, T_STRING);
|
||||
Check_Type (data, T_STRING);
|
||||
Check_Type (where, T_STRING);
|
||||
Check_Type (user_data, T_STRING);
|
||||
|
||||
c_weelist = STR2CSTR (weelist);
|
||||
c_data = STR2CSTR (data);
|
||||
c_where = STR2CSTR (where);
|
||||
c_user_data = STR2CSTR (user_data);
|
||||
|
||||
result = script_ptr2str (weechat_list_add (script_str2ptr(c_weelist),
|
||||
c_data,
|
||||
c_where));
|
||||
c_where,
|
||||
script_str2ptr (c_user_data)));
|
||||
|
||||
RUBY_RETURN_STRING(result);
|
||||
}
|
||||
@@ -6590,7 +6595,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
|
||||
rb_define_module_function (ruby_mWeechat, "mkdir", &weechat_ruby_api_mkdir, 2);
|
||||
rb_define_module_function (ruby_mWeechat, "mkdir_parents", &weechat_ruby_api_mkdir_parents, 2);
|
||||
rb_define_module_function (ruby_mWeechat, "list_new", &weechat_ruby_api_list_new, 0);
|
||||
rb_define_module_function (ruby_mWeechat, "list_add", &weechat_ruby_api_list_add, 3);
|
||||
rb_define_module_function (ruby_mWeechat, "list_add", &weechat_ruby_api_list_add, 4);
|
||||
rb_define_module_function (ruby_mWeechat, "list_search", &weechat_ruby_api_list_search, 2);
|
||||
rb_define_module_function (ruby_mWeechat, "list_casesearch", &weechat_ruby_api_list_casesearch, 2);
|
||||
rb_define_module_function (ruby_mWeechat, "list_get", &weechat_ruby_api_list_get, 2);
|
||||
|
||||
@@ -622,7 +622,7 @@ weechat_tcl_api_list_add (ClientData clientData, Tcl_Interp *interp,
|
||||
int objc, Tcl_Obj *CONST objv[])
|
||||
{
|
||||
Tcl_Obj* objp;
|
||||
char *result, *weelist, *data, *where;
|
||||
char *result, *weelist, *data, *where, *user_data;
|
||||
int i;
|
||||
|
||||
/* make C compiler happy */
|
||||
@@ -635,7 +635,7 @@ weechat_tcl_api_list_add (ClientData clientData, Tcl_Interp *interp,
|
||||
TCL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (objc < 4)
|
||||
if (objc < 5)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("list_add");
|
||||
TCL_RETURN_EMPTY;
|
||||
@@ -644,9 +644,11 @@ weechat_tcl_api_list_add (ClientData clientData, Tcl_Interp *interp,
|
||||
weelist = Tcl_GetStringFromObj (objv[1], &i);
|
||||
data = Tcl_GetStringFromObj (objv[2], &i);
|
||||
where = Tcl_GetStringFromObj (objv[3], &i);
|
||||
user_data = Tcl_GetStringFromObj (objv[4], &i);
|
||||
result = script_ptr2str (weechat_list_add (script_str2ptr (weelist),
|
||||
data,
|
||||
where));
|
||||
where,
|
||||
script_str2ptr (user_data)));
|
||||
|
||||
TCL_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
@@ -203,7 +203,8 @@ struct t_weechat_plugin
|
||||
struct t_weelist *(*list_new) ();
|
||||
struct t_weelist_item *(*list_add) (struct t_weelist *weelist,
|
||||
const char *data,
|
||||
const char *where);
|
||||
const char *where,
|
||||
void *user_data);
|
||||
struct t_weelist_item *(*list_search) (struct t_weelist *weelist,
|
||||
const char *data);
|
||||
struct t_weelist_item *(*list_casesearch) (struct t_weelist *weelist,
|
||||
@@ -752,8 +753,8 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
|
||||
/* sorted list */
|
||||
#define weechat_list_new() \
|
||||
weechat_plugin->list_new()
|
||||
#define weechat_list_add(__list, __string, __where) \
|
||||
weechat_plugin->list_add(__list, __string, __where)
|
||||
#define weechat_list_add(__list, __string, __where, __user_data) \
|
||||
weechat_plugin->list_add(__list, __string, __where, __user_data)
|
||||
#define weechat_list_search(__list, __string) \
|
||||
weechat_plugin->list_search(__list, __string)
|
||||
#define weechat_list_casesearch(__list, __string) \
|
||||
|
||||
Reference in New Issue
Block a user