diff --git a/src/plugins/fset/fset-completion.c b/src/plugins/fset/fset-completion.c index e4d4ba7a9..3fe765e5e 100644 --- a/src/plugins/fset/fset-completion.c +++ b/src/plugins/fset/fset-completion.c @@ -38,7 +38,8 @@ fset_completion_option_cb (const void *pointer, void *data, struct t_config_file *ptr_config; struct t_config_section *ptr_section; struct t_config_option *ptr_option; - int config_section_added; + char **words; + int config_section_added, num_words, i; /* make C compiler happy */ (void) pointer; @@ -73,10 +74,18 @@ fset_completion_option_cb (const void *pointer, void *data, 0, WEECHAT_LIST_POS_SORT); config_section_added = 1; } - weechat_hook_completion_list_add ( - completion, + words = weechat_string_split ( weechat_config_option_get_string (ptr_option, "name"), - 0, WEECHAT_LIST_POS_SORT); + "_", 0, 0, &num_words); + if (words) + { + for (i = 0; i < num_words; i++) + { + weechat_hook_completion_list_add ( + completion, words[i], 0, WEECHAT_LIST_POS_SORT); + } + weechat_string_free_split (words); + } ptr_option = weechat_hdata_move (fset_hdata_config_option, ptr_option, 1); }