1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 09:13:14 +02:00

Added completion hook, to let plugins add custom completions for commands

This commit is contained in:
Sebastien Helleu
2007-12-07 15:01:37 +01:00
parent 495e6bd5df
commit 72a694ed4c
9 changed files with 230 additions and 23 deletions
+19 -1
View File
@@ -1020,7 +1020,7 @@ command_plugin_list (char *name, int full)
{
if (!hook_found)
gui_chat_printf (NULL,
_(" configuration otions "
_(" configuration options "
"hooked:"));
hook_found = 1;
gui_chat_printf (NULL,
@@ -1031,6 +1031,24 @@ command_plugin_list (char *name, int full)
HOOK_CONFIG(ptr_hook, option) : "*");
}
}
/* completion hooked */
hook_found = 0;
for (ptr_hook = weechat_hooks; ptr_hook;
ptr_hook = ptr_hook->next_hook)
{
if ((ptr_hook->plugin == ptr_plugin)
&& (ptr_hook->type == HOOK_TYPE_COMPLETION))
{
if (!hook_found)
gui_chat_printf (NULL,
_(" completion hooked:"));
hook_found = 1;
gui_chat_printf (NULL,
" %s",
HOOK_COMPLETION(ptr_hook, completion));
}
}
}
}
}