summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2006-07-27 16:04:46 +0000
committerSebastien Helleu <flashcode@flashtux.org>2006-07-27 16:04:46 +0000
commit06cc936937ba0b43fc4db4474c208494b3efdd74 (patch)
tree004e3d602f3008c879b6bb92a350b7774db44944
parentFixed nick alignment problem when look_nickmode is off (diff)
downloadweechat-06cc936937ba0b43fc4db4474c208494b3efdd74.tar.xz
weechat-06cc936937ba0b43fc4db4474c208494b3efdd74.zip
Fixed completion for command handlers (now empty completion_template means nick completion, "-" string means no completion at all)
-rw-r--r--ChangeLog2
-rw-r--r--doc/de/weechat.de.xml4
-rw-r--r--doc/en/weechat.en.xml4
-rw-r--r--doc/fr/weechat.fr.xml4
-rw-r--r--src/common/completion.c3
-rw-r--r--src/plugins/plugins.c2
-rw-r--r--weechat/ChangeLog2
-rw-r--r--weechat/doc/de/weechat.de.xml4
-rw-r--r--weechat/doc/en/weechat.en.xml4
-rw-r--r--weechat/doc/fr/weechat.fr.xml4
-rw-r--r--weechat/src/common/completion.c3
-rw-r--r--weechat/src/plugins/plugins.c2
12 files changed, 22 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 0da37642f..996446496 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,8 @@ WeeChat - Wee Enhanced Environment for Chat
ChangeLog - 2006-07-27
Version 0.2.0 (under dev!):
+ * fixed completion for command handlers (now empty completion_template
+ means nick completion, "-" string means no completion at all)
* fixed nick alignment problem when look_nickmode is off
* added generic function for incoming numeric IRC commands (bug #16611)
* fixed crash when doing "/part something" on a server buffer (bug #17201)
diff --git a/doc/de/weechat.de.xml b/doc/de/weechat.de.xml
index 0674ea94b..07c5534ae 100644
--- a/doc/de/weechat.de.xml
+++ b/doc/de/weechat.de.xml
@@ -1935,8 +1935,8 @@ plugin->msg_handler_add (plugin, "KICK", &amp;msg_kick, NULL, NULL);
bedeutet "<literal>abc|%w def|%i</literal>", dass das erste Argument "abc" oder ein
WeeChat-Kommando sein kann und das zweite Argument "def" oder ein IRC-Kommando.
Eine leere Zeichenkette bedeutet, dass WeeChat für jedes Argument einen Nicknamen
- des gegenwärtigen Channels einsetzt, ein NULL schaltet die Vervollständigung für alle
- Argumente ab.
+ des gegenwärtigen Channels einsetzt, ein NULL oder "-" schaltet die Vervollständigung
+ für alle Argumente ab.
</para>
<para>
Die folgenden Ersetzungen können verwendet werden:
diff --git a/doc/en/weechat.en.xml b/doc/en/weechat.en.xml
index 096dc850f..9432f1e38 100644
--- a/doc/en/weechat.en.xml
+++ b/doc/en/weechat.en.xml
@@ -1952,8 +1952,8 @@ plugin->msg_handler_add (plugin, "KICK", &amp;msg_kick, NULL, NULL);
which means "abc" or a WeeChat command for first argument,
"def" or IRC command for second.
An empty string lets WeeChat complete any argument with
- a nick from current channel, NULL disable completion for
- all command arguments.
+ a nick from current channel, NULL or "-" disable completion
+ for all command arguments.
</para>
<para>
Following codes can be used:
diff --git a/doc/fr/weechat.fr.xml b/doc/fr/weechat.fr.xml
index 19644edb4..82eb1cc22 100644
--- a/doc/fr/weechat.fr.xml
+++ b/doc/fr/weechat.fr.xml
@@ -1993,8 +1993,8 @@ plugin->msg_handler_add (plugin, "KICK", &amp;msg_kick, NULL, NULL);
paramètre, et "def" ou une commande IRC pour le deuxième.
Une chaîne vide indique à WeeChat de compléter tout
paramètre avec un pseudo du canal courant, une valeur NULL
- désactive toute complétion pour tous les paramètres de la
- commande.
+ ou égale à "-" désactive toute complétion pour tous les
+ paramètres de la commande.
</para>
<para>
Les codes suivants peuvent être utilisés :
diff --git a/src/common/completion.c b/src/common/completion.c
index 2a8cf5069..f61c9976c 100644
--- a/src/common/completion.c
+++ b/src/common/completion.c
@@ -820,7 +820,8 @@ completion_build_list (t_completion *completion)
int max_arg, i;
completion_get_command_infos (completion, &template, &max_arg);
- if (!template || (completion->base_command_arg > max_arg))
+ if (!template || (strcmp (template, "-") == 0) ||
+ (completion->base_command_arg > max_arg))
{
completion_stop (completion);
return;
diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c
index c99b16895..7639c6aba 100644
--- a/src/plugins/plugins.c
+++ b/src/plugins/plugins.c
@@ -301,7 +301,7 @@ plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
new_handler->description = (description) ? strdup (description) : NULL;
new_handler->arguments = (arguments) ? strdup (arguments) : NULL;
new_handler->arguments_description = (arguments_description) ? strdup (arguments_description) : NULL;
- new_handler->completion_template = (completion_template) ? strdup (completion_template) : NULL;
+ new_handler->completion_template = (completion_template) ? strdup (completion_template) : strdup ("");
new_handler->interval = 0;
new_handler->remaining = 0;
new_handler->handler = handler_func;
diff --git a/weechat/ChangeLog b/weechat/ChangeLog
index 0da37642f..996446496 100644
--- a/weechat/ChangeLog
+++ b/weechat/ChangeLog
@@ -4,6 +4,8 @@ WeeChat - Wee Enhanced Environment for Chat
ChangeLog - 2006-07-27
Version 0.2.0 (under dev!):
+ * fixed completion for command handlers (now empty completion_template
+ means nick completion, "-" string means no completion at all)
* fixed nick alignment problem when look_nickmode is off
* added generic function for incoming numeric IRC commands (bug #16611)
* fixed crash when doing "/part something" on a server buffer (bug #17201)
diff --git a/weechat/doc/de/weechat.de.xml b/weechat/doc/de/weechat.de.xml
index 0674ea94b..07c5534ae 100644
--- a/weechat/doc/de/weechat.de.xml
+++ b/weechat/doc/de/weechat.de.xml
@@ -1935,8 +1935,8 @@ plugin->msg_handler_add (plugin, "KICK", &amp;msg_kick, NULL, NULL);
bedeutet "<literal>abc|%w def|%i</literal>", dass das erste Argument "abc" oder ein
WeeChat-Kommando sein kann und das zweite Argument "def" oder ein IRC-Kommando.
Eine leere Zeichenkette bedeutet, dass WeeChat für jedes Argument einen Nicknamen
- des gegenwärtigen Channels einsetzt, ein NULL schaltet die Vervollständigung für alle
- Argumente ab.
+ des gegenwärtigen Channels einsetzt, ein NULL oder "-" schaltet die Vervollständigung
+ für alle Argumente ab.
</para>
<para>
Die folgenden Ersetzungen können verwendet werden:
diff --git a/weechat/doc/en/weechat.en.xml b/weechat/doc/en/weechat.en.xml
index 096dc850f..9432f1e38 100644
--- a/weechat/doc/en/weechat.en.xml
+++ b/weechat/doc/en/weechat.en.xml
@@ -1952,8 +1952,8 @@ plugin->msg_handler_add (plugin, "KICK", &amp;msg_kick, NULL, NULL);
which means "abc" or a WeeChat command for first argument,
"def" or IRC command for second.
An empty string lets WeeChat complete any argument with
- a nick from current channel, NULL disable completion for
- all command arguments.
+ a nick from current channel, NULL or "-" disable completion
+ for all command arguments.
</para>
<para>
Following codes can be used:
diff --git a/weechat/doc/fr/weechat.fr.xml b/weechat/doc/fr/weechat.fr.xml
index 19644edb4..82eb1cc22 100644
--- a/weechat/doc/fr/weechat.fr.xml
+++ b/weechat/doc/fr/weechat.fr.xml
@@ -1993,8 +1993,8 @@ plugin->msg_handler_add (plugin, "KICK", &amp;msg_kick, NULL, NULL);
paramètre, et "def" ou une commande IRC pour le deuxième.
Une chaîne vide indique à WeeChat de compléter tout
paramètre avec un pseudo du canal courant, une valeur NULL
- désactive toute complétion pour tous les paramètres de la
- commande.
+ ou égale à "-" désactive toute complétion pour tous les
+ paramètres de la commande.
</para>
<para>
Les codes suivants peuvent être utilisés :
diff --git a/weechat/src/common/completion.c b/weechat/src/common/completion.c
index 2a8cf5069..f61c9976c 100644
--- a/weechat/src/common/completion.c
+++ b/weechat/src/common/completion.c
@@ -820,7 +820,8 @@ completion_build_list (t_completion *completion)
int max_arg, i;
completion_get_command_infos (completion, &template, &max_arg);
- if (!template || (completion->base_command_arg > max_arg))
+ if (!template || (strcmp (template, "-") == 0) ||
+ (completion->base_command_arg > max_arg))
{
completion_stop (completion);
return;
diff --git a/weechat/src/plugins/plugins.c b/weechat/src/plugins/plugins.c
index c99b16895..7639c6aba 100644
--- a/weechat/src/plugins/plugins.c
+++ b/weechat/src/plugins/plugins.c
@@ -301,7 +301,7 @@ plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
new_handler->description = (description) ? strdup (description) : NULL;
new_handler->arguments = (arguments) ? strdup (arguments) : NULL;
new_handler->arguments_description = (arguments_description) ? strdup (arguments_description) : NULL;
- new_handler->completion_template = (completion_template) ? strdup (completion_template) : NULL;
+ new_handler->completion_template = (completion_template) ? strdup (completion_template) : strdup ("");
new_handler->interval = 0;
new_handler->remaining = 0;
new_handler->handler = handler_func;