summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-05-02 22:39:06 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-05-02 22:39:06 +0000
commit70d377b865b44a07e069c15466813d19307c5d34 (patch)
treef0a0d6876d53c53afb52973b339b861b12d1bcfe /src
parentf376e558f7ff58cd9bccc773964e27cbc43fcf11 (diff)
downloadirssi-70d377b865b44a07e069c15466813d19307c5d34.zip
Added completion for /LOAD and /WINDOW ITEM MOVE.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2749 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/fe-common/core/chat-completion.c13
-rw-r--r--src/fe-common/core/completion.c2
2 files changed, 15 insertions, 0 deletions
diff --git a/src/fe-common/core/chat-completion.c b/src/fe-common/core/chat-completion.c
index 2c23a6ab..df5525eb 100644
--- a/src/fe-common/core/chat-completion.c
+++ b/src/fe-common/core/chat-completion.c
@@ -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);
diff --git a/src/fe-common/core/completion.c b/src/fe-common/core/completion.c
index 33287b73..99046b9f 100644
--- a/src/fe-common/core/completion.c
+++ b/src/fe-common/core/completion.c
@@ -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);