mirror of
https://github.com/irssi/irssi.git
synced 2026-08-09 11:50:10 +02:00
/connect + /server server/chatnet completion by tommik.
Completion works now with commands that optionally could have subcommands, like /server l<tab> could return list (subcommand) or localhost (server). git-svn-id: http://svn.irssi.org/repos/irssi/trunk@751 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
98060c3185
commit
4c882129c3
2 changed files with 70 additions and 12 deletions
|
|
@ -495,17 +495,6 @@ static void sig_complete_word(GList **list, WINDOW_REC *window,
|
|||
line = linestart[1] == *cmdchars ? g_strdup(linestart+2) :
|
||||
expand_aliases(linestart+1);
|
||||
|
||||
if (command_have_sub(line)) {
|
||||
/* complete subcommand */
|
||||
cmd = g_strconcat(line, " ", word, NULL);
|
||||
*list = completion_get_subcommands(cmd);
|
||||
g_free(cmd);
|
||||
|
||||
if (*list != NULL) signal_stop();
|
||||
g_free(line);
|
||||
return;
|
||||
}
|
||||
|
||||
cmd = line_get_command(line, &args, FALSE);
|
||||
if (cmd == NULL) {
|
||||
g_free(line);
|
||||
|
|
@ -514,7 +503,7 @@ static void sig_complete_word(GList **list, WINDOW_REC *window,
|
|||
|
||||
/* we're completing -option? */
|
||||
if (*word == '-') {
|
||||
*list = completion_get_options(cmd, word+1);
|
||||
*list = completion_get_options(cmd, word+1);
|
||||
g_free(cmd);
|
||||
g_free(line);
|
||||
return;
|
||||
|
|
@ -524,6 +513,15 @@ static void sig_complete_word(GList **list, WINDOW_REC *window,
|
|||
signal = g_strconcat("complete command ", cmd, NULL);
|
||||
signal_emit(signal, 5, list, window, word, args, want_space);
|
||||
|
||||
if (command_have_sub(line)) {
|
||||
/* complete subcommand */
|
||||
g_free(cmd);
|
||||
cmd = g_strconcat(line, " ", word, NULL);
|
||||
*list = g_list_concat(completion_get_subcommands(cmd), *list);
|
||||
|
||||
if (*list != NULL) signal_stop();
|
||||
}
|
||||
|
||||
g_free(signal);
|
||||
g_free(cmd);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue