mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 21:06:38 +02:00
trigger: add option "restore" in command /trigger
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "../weechat-plugin.h"
|
||||
#include "trigger.h"
|
||||
#include "trigger-config.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -53,6 +54,33 @@ trigger_completion_triggers_cb (void *data, const char *completion_item,
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds default triggers to completion list.
|
||||
*/
|
||||
|
||||
int
|
||||
trigger_completion_triggers_default_cb (void *data,
|
||||
const char *completion_item,
|
||||
struct t_gui_buffer *buffer,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
(void) buffer;
|
||||
|
||||
for (i = 0; trigger_config_default_list[i][0]; i++)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion,
|
||||
trigger_config_default_list[i][0],
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds options for triggers to completion list.
|
||||
*/
|
||||
@@ -393,6 +421,9 @@ trigger_completion_init ()
|
||||
weechat_hook_completion ("trigger_names",
|
||||
N_("triggers"),
|
||||
&trigger_completion_triggers_cb, NULL);
|
||||
weechat_hook_completion ("trigger_names_default",
|
||||
N_("default triggers"),
|
||||
&trigger_completion_triggers_default_cb, NULL);
|
||||
weechat_hook_completion ("trigger_options",
|
||||
N_("options for triggers"),
|
||||
&trigger_completion_options_cb, NULL);
|
||||
|
||||
Reference in New Issue
Block a user