diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-04-03 17:56:40 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-04-03 17:56:40 +0200 |
commit | 7c58018cb109cd50c9b80980adff9b7ff508c2c2 (patch) | |
tree | d554b826fca3711ad4f0fa8dc7722416a2ac45b9 /src | |
parent | 76b700a55552891d29bd09c83d1ab001bef4e449 (diff) | |
download | weechat-7c58018cb109cd50c9b80980adff9b7ff508c2c2.zip |
Add new option "weechat.completion.nick_add_space" (add space after nick completion, on by default)
Diffstat (limited to 'src')
-rw-r--r-- | src/core/wee-config.c | 7 | ||||
-rw-r--r-- | src/core/wee-config.h | 1 | ||||
-rw-r--r-- | src/gui/gui-completion.c | 5 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 239c26167..38c549663 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -145,6 +145,7 @@ struct t_config_option *config_color_nicklist_separator; /* config, completion section */ struct t_config_option *config_completion_default_template; +struct t_config_option *config_completion_nick_add_space; struct t_config_option *config_completion_nick_completor; struct t_config_option *config_completion_nick_first_only; struct t_config_option *config_completion_nick_ignore_chars; @@ -1605,6 +1606,12 @@ config_weechat_init_options () "codes and values)"), NULL, 0, 0, "%n|%(irc_channels)", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_nick_add_space = config_file_new_option ( + weechat_config_file, ptr_section, + "nick_add_space", "boolean", + N_("add space after nick completion (when nick is not first word on " + "command line)"), + NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_nick_completor = config_file_new_option ( weechat_config_file, ptr_section, "nick_completor", "string", diff --git a/src/core/wee-config.h b/src/core/wee-config.h index 1ef819e14..f8754ae2e 100644 --- a/src/core/wee-config.h +++ b/src/core/wee-config.h @@ -147,6 +147,7 @@ extern struct t_config_option *config_color_nicklist_more; extern struct t_config_option *config_color_nicklist_separator; extern struct t_config_option *config_completion_default_template; +extern struct t_config_option *config_completion_nick_add_space; extern struct t_config_option *config_completion_nick_completor; extern struct t_config_option *config_completion_nick_first_only; extern struct t_config_option *config_completion_nick_ignore_chars; diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c index a1ec06246..482c55fd2 100644 --- a/src/gui/gui-completion.c +++ b/src/gui/gui-completion.c @@ -1501,6 +1501,11 @@ gui_completion_complete (struct t_gui_completion *completion) free (completion->word_found); completion->word_found = strdup (ptr_item->data); completion->word_found_is_nick = item_is_nick; + if (item_is_nick && (completion->base_word_pos > 0) + && !CONFIG_BOOLEAN(config_completion_nick_add_space)) + { + completion->add_space = 0; + } /* stop after first nick if user asked that */ if (item_is_nick |