mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04:14:16 -04:00
Make completer for action/msg/query more self-contained by completing nicks in
the active channel. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4443 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
9898328865
commit
d701ef4024
@ -579,14 +579,11 @@ GList *completion_get_aliases(const char *word)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void complete_window_nicks(GList **list, WINDOW_REC *window,
|
static void complete_window_nicks(GList **list, WINDOW_REC *window,
|
||||||
const char *word, const char *linestart)
|
const char *word, const char *nicksuffix)
|
||||||
{
|
{
|
||||||
CHANNEL_REC *channel;
|
CHANNEL_REC *channel;
|
||||||
GList *tmplist;
|
GList *tmplist;
|
||||||
GSList *tmp;
|
GSList *tmp;
|
||||||
const char *nicksuffix;
|
|
||||||
|
|
||||||
nicksuffix = *linestart != '\0' ? NULL : completion_char;
|
|
||||||
|
|
||||||
channel = CHANNEL(window->active);
|
channel = CHANNEL(window->active);
|
||||||
|
|
||||||
@ -663,7 +660,8 @@ static void sig_complete_word(GList **list, WINDOW_REC *window,
|
|||||||
} else if (channel != NULL) {
|
} else if (channel != NULL) {
|
||||||
/* nick completion .. we could also be completing a nick
|
/* nick completion .. we could also be completing a nick
|
||||||
after /MSG from nicks in channel */
|
after /MSG from nicks in channel */
|
||||||
complete_window_nicks(list, window, word, linestart);
|
const char *suffix = *linestart != '\0' ? NULL : completion_char;
|
||||||
|
complete_window_nicks(list, window, word, suffix);
|
||||||
} else if (window->level & MSGLEVEL_MSGS) {
|
} else if (window->level & MSGLEVEL_MSGS) {
|
||||||
/* msgs window, complete /MSG nicks */
|
/* msgs window, complete /MSG nicks */
|
||||||
*list = g_list_concat(completion_msg(server, NULL, word, NULL), *list);
|
*list = g_list_concat(completion_msg(server, NULL, word, NULL), *list);
|
||||||
@ -707,6 +705,8 @@ static void sig_complete_msg(GList **list, WINDOW_REC *window,
|
|||||||
|
|
||||||
msgserver = line_get_server(line);
|
msgserver = line_get_server(line);
|
||||||
*list = completion_msg(server, msgserver, word, NULL);
|
*list = completion_msg(server, msgserver, word, NULL);
|
||||||
|
if (CHANNEL(window->active) != NULL)
|
||||||
|
complete_window_nicks(list, window, word, NULL);
|
||||||
if (*list != NULL) signal_stop();
|
if (*list != NULL) signal_stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user