mirror of
https://github.com/weechat/weechat.git
synced 2026-07-03 16:23:14 +02:00
Add new option "weechat.completion.nick_add_space" (add space after nick completion, on by default)
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user