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:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user