summaryrefslogtreecommitdiff
path: root/src
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 /src
parent451f623c9881867de4895e4dbc5908ad1a1699f0 (diff)
downloadweechat-06cc936937ba0b43fc4db4474c208494b3efdd74.zip
Fixed completion for command handlers (now empty completion_template means nick completion, "-" string means no completion at all)
Diffstat (limited to 'src')
-rw-r--r--src/common/completion.c3
-rw-r--r--src/plugins/plugins.c2
2 files changed, 3 insertions, 2 deletions
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;