summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-01-23 18:24:08 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-01-23 18:24:08 +0000
commit159fa3d806ef5fd1288675289ffa13d179bed13d (patch)
tree697bce5361c9689222ad555a192de961725b52ca /src
parent07686bf69bce9eeddd279a3cbc485b484655aa84 (diff)
downloadweechat-159fa3d806ef5fd1288675289ffa13d179bed13d.zip
Improved completion for /set command (now adds '=' at the end)
Diffstat (limited to 'src')
-rw-r--r--src/common/command.c15
-rw-r--r--src/common/completion.c6
2 files changed, 19 insertions, 2 deletions
diff --git a/src/common/command.c b/src/common/command.c
index 29e600112..b87640f6f 100644
--- a/src/common/command.c
+++ b/src/common/command.c
@@ -1698,7 +1698,21 @@ weechat_cmd_set (char *arguments)
if (value)
{
value[0] = '\0';
+
+ /* remove spaces before '=' */
+ pos = value - 1;
+ while ((pos > option) && (pos[0] == ' '))
+ {
+ pos[0] = '\0';
+ pos--;
+ }
+
+ /* skip spaces after '=' */
value++;
+ while (value[0] && (value[0] == ' '))
+ {
+ value++;
+ }
}
}
@@ -1775,6 +1789,7 @@ weechat_cmd_set (char *arguments)
if (config_option_set_value (ptr_option, value) == 0)
{
(void) (ptr_option->handler_change());
+ irc_display_prefix (NULL, PREFIX_INFO);
gui_printf_color (NULL, COLOR_WIN_CHAT_DARK, "[");
gui_printf_color (NULL, COLOR_WIN_CHAT_CHANNEL,
"%s", config_get_section (ptr_option));
diff --git a/src/common/completion.c b/src/common/completion.c
index e28c4286f..1ca4ad225 100644
--- a/src/common/completion.c
+++ b/src/common/completion.c
@@ -199,9 +199,11 @@ completion_build_list (t_completion *completion, void *channel)
{
for (j = 0; weechat_options[i][j].option_name; j++)
{
+ snprintf (option_name, sizeof (option_name), "%s =",
+ weechat_options[i][j].option_name);
weelist_add (&completion->completion_list,
&completion->last_completion,
- weechat_options[i][j].option_name);
+ option_name);
}
}
}
@@ -210,7 +212,7 @@ completion_build_list (t_completion *completion, void *channel)
{
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
{
- snprintf (option_name, sizeof (option_name), "%s.%s",
+ snprintf (option_name, sizeof (option_name), "%s.%s =",
ptr_server->name,
weechat_options[CONFIG_SECTION_SERVER][i].option_name);
weelist_add (&completion->completion_list,