1
0
Fork 0

Added completion for /LOAD and /WINDOW ITEM MOVE.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2749 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-05-02 22:39:06 +00:00 committed by cras
parent f376e558f7
commit 70d377b865
2 changed files with 15 additions and 0 deletions

View File

@ -757,6 +757,17 @@ static void sig_complete_topic(GList **list, WINDOW_REC *window,
}
}
static void sig_complete_channel(GList **list, WINDOW_REC *window,
const char *word, const char *line,
int *want_space)
{
g_return_if_fail(list != NULL);
g_return_if_fail(word != NULL);
*list = completion_get_channels(NULL, word);
if (*list != NULL) signal_stop();
}
/* expand \n, \t and \\ */
static char *expand_escapes(const char *line, SERVER_REC *server,
WI_ITEM_REC *item)
@ -921,6 +932,7 @@ void chat_completion_init(void)
signal_add("complete command connect", (SIGNAL_FUNC) sig_complete_connect);
signal_add("complete command server", (SIGNAL_FUNC) sig_complete_connect);
signal_add("complete command topic", (SIGNAL_FUNC) sig_complete_topic);
signal_add("complete command window item move", (SIGNAL_FUNC) sig_complete_channel);
signal_add("message public", (SIGNAL_FUNC) sig_message_public);
signal_add("message join", (SIGNAL_FUNC) sig_message_join);
signal_add("message private", (SIGNAL_FUNC) sig_message_private);
@ -949,6 +961,7 @@ void chat_completion_deinit(void)
signal_remove("complete command connect", (SIGNAL_FUNC) sig_complete_connect);
signal_remove("complete command server", (SIGNAL_FUNC) sig_complete_connect);
signal_remove("complete command topic", (SIGNAL_FUNC) sig_complete_topic);
signal_remove("complete command window item move", (SIGNAL_FUNC) sig_complete_channel);
signal_remove("message public", (SIGNAL_FUNC) sig_message_public);
signal_remove("message join", (SIGNAL_FUNC) sig_message_join);
signal_remove("message private", (SIGNAL_FUNC) sig_message_private);

View File

@ -745,6 +745,7 @@ void completion_init(void)
signal_add_first("complete erase", (SIGNAL_FUNC) sig_complete_erase);
signal_add("complete command set", (SIGNAL_FUNC) sig_complete_set);
signal_add("complete command toggle", (SIGNAL_FUNC) sig_complete_toggle);
signal_add("complete command load", (SIGNAL_FUNC) sig_complete_filename);
signal_add("complete command cat", (SIGNAL_FUNC) sig_complete_filename);
signal_add("complete command save", (SIGNAL_FUNC) sig_complete_filename);
signal_add("complete command reload", (SIGNAL_FUNC) sig_complete_filename);
@ -763,6 +764,7 @@ void completion_deinit(void)
signal_remove("complete erase", (SIGNAL_FUNC) sig_complete_erase);
signal_remove("complete command set", (SIGNAL_FUNC) sig_complete_set);
signal_remove("complete command toggle", (SIGNAL_FUNC) sig_complete_toggle);
signal_remove("complete command load", (SIGNAL_FUNC) sig_complete_filename);
signal_remove("complete command cat", (SIGNAL_FUNC) sig_complete_filename);
signal_remove("complete command save", (SIGNAL_FUNC) sig_complete_filename);
signal_remove("complete command reload", (SIGNAL_FUNC) sig_complete_filename);