summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-08-16 15:02:01 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-08-16 15:02:01 +0000
commit3f946e304d18d384bb2f84cf0e5f3f512008ff4c (patch)
tree0afde10cb1a370a4c1de53b44fe918607e16c5a9
parent97b6bbcb9e1f20c7cad21ee1395d75c52bc0ba66 (diff)
downloadweechat-3f946e304d18d384bb2f84cf0e5f3f512008ff4c.zip
Added completion for internal functions with /key command
-rw-r--r--src/common/completion.c38
-rw-r--r--weechat/src/common/completion.c38
2 files changed, 52 insertions, 24 deletions
diff --git a/src/common/completion.c b/src/common/completion.c
index 4303eedc2..decfad2c8 100644
--- a/src/common/completion.c
+++ b/src/common/completion.c
@@ -201,19 +201,33 @@ completion_build_list (t_completion *completion, void *channel)
}
return;
}
- if ((strcasecmp (completion->base_command, "key") == 0)
- && (completion->base_command_arg == 1))
+ if (strcasecmp (completion->base_command, "key") == 0)
{
- weelist_add (&completion->completion_list,
- &completion->last_completion,
- "unbind");
- weelist_add (&completion->completion_list,
- &completion->last_completion,
- "functions");
- weelist_add (&completion->completion_list,
- &completion->last_completion,
- "reset");
- return;
+ if (completion->base_command_arg == 1)
+ {
+ weelist_add (&completion->completion_list,
+ &completion->last_completion,
+ "unbind");
+ weelist_add (&completion->completion_list,
+ &completion->last_completion,
+ "functions");
+ weelist_add (&completion->completion_list,
+ &completion->last_completion,
+ "reset");
+ return;
+ }
+ if (completion->base_command_arg == 2)
+ {
+ i = 0;
+ while (gui_key_functions[i].function_name)
+ {
+ weelist_add (&completion->completion_list,
+ &completion->last_completion,
+ gui_key_functions[i].function_name);
+ i++;
+ }
+ return;
+ }
}
if (((strcasecmp (completion->base_command, "perl") == 0)
|| (strcasecmp (completion->base_command, "python") == 0))
diff --git a/weechat/src/common/completion.c b/weechat/src/common/completion.c
index 4303eedc2..decfad2c8 100644
--- a/weechat/src/common/completion.c
+++ b/weechat/src/common/completion.c
@@ -201,19 +201,33 @@ completion_build_list (t_completion *completion, void *channel)
}
return;
}
- if ((strcasecmp (completion->base_command, "key") == 0)
- && (completion->base_command_arg == 1))
+ if (strcasecmp (completion->base_command, "key") == 0)
{
- weelist_add (&completion->completion_list,
- &completion->last_completion,
- "unbind");
- weelist_add (&completion->completion_list,
- &completion->last_completion,
- "functions");
- weelist_add (&completion->completion_list,
- &completion->last_completion,
- "reset");
- return;
+ if (completion->base_command_arg == 1)
+ {
+ weelist_add (&completion->completion_list,
+ &completion->last_completion,
+ "unbind");
+ weelist_add (&completion->completion_list,
+ &completion->last_completion,
+ "functions");
+ weelist_add (&completion->completion_list,
+ &completion->last_completion,
+ "reset");
+ return;
+ }
+ if (completion->base_command_arg == 2)
+ {
+ i = 0;
+ while (gui_key_functions[i].function_name)
+ {
+ weelist_add (&completion->completion_list,
+ &completion->last_completion,
+ gui_key_functions[i].function_name);
+ i++;
+ }
+ return;
+ }
}
if (((strcasecmp (completion->base_command, "perl") == 0)
|| (strcasecmp (completion->base_command, "python") == 0))