1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-08 10:43:13 +02:00

core: add option weechat.completion.cycle

This commit is contained in:
Sébastien Helleu
2025-09-11 21:10:52 +02:00
parent 767ea84909
commit e2ae308e3b
18 changed files with 103 additions and 16 deletions
+9
View File
@@ -305,6 +305,7 @@ struct t_config_option *config_color_status_time = NULL;
struct t_config_option *config_completion_base_word_until_cursor = NULL;
struct t_config_option *config_completion_case_sensitive = NULL;
struct t_config_option *config_completion_command_inline = NULL;
struct t_config_option *config_completion_cycle = NULL;
struct t_config_option *config_completion_default_template = NULL;
struct t_config_option *config_completion_nick_add_space = NULL;
struct t_config_option *config_completion_nick_case_sensitive = NULL;
@@ -5185,6 +5186,14 @@ config_weechat_init_options (void)
"commands arguments)"),
NULL, 0, 0, "on", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_cycle = config_file_new_option (
weechat_config_file, weechat_config_section_completion,
"cycle", "boolean",
N_("if enabled, restart from beginning (first completion found) "
"when the last completion is reached, otherwise stop at last "
"completion"),
NULL, 0, 0, "on", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_default_template = config_file_new_option (
weechat_config_file, weechat_config_section_completion,
"default_template", "string",
+1
View File
@@ -354,6 +354,7 @@ extern struct t_config_option *config_color_status_time;
extern struct t_config_option *config_completion_base_word_until_cursor;
extern struct t_config_option *config_completion_case_sensitive;
extern struct t_config_option *config_completion_command_inline;
extern struct t_config_option *config_completion_cycle;
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_case_sensitive;
+2 -1
View File
@@ -1384,7 +1384,8 @@ gui_completion_complete (struct t_gui_completion *completion)
* if we was on last completion in list, then complete again, starting from
* first matching item
*/
if (completion->word_found && (completion->position >= 0))
if (CONFIG_BOOLEAN(config_completion_cycle)
&& completion->word_found && (completion->position >= 0))
{
free (completion->word_found);
completion->word_found = NULL;