diff --git a/src/fe-common/core/completion.c b/src/fe-common/core/completion.c index 0e9982d5..c87fdb50 100644 --- a/src/fe-common/core/completion.c +++ b/src/fe-common/core/completion.c @@ -690,19 +690,20 @@ static void sig_complete_set(GList **list, WINDOW_REC *window, else if (*line != '\0' && *word == '\0') { SETTINGS_REC *rec = settings_get_record(line); if (rec != NULL) { + char *value = settings_get_print(rec); + + /* show the current option first */ + if (value != NULL) + *list = g_list_append(*list, value); + /* show the whole list of valid options */ if (rec->type == SETTING_TYPE_CHOICE) { - char **tmp = rec->choices; + char **tmp; - while (*tmp) - *list = g_list_append(*list, g_strdup(*tmp++)); - } - /* show the current option */ - else { - char *value = settings_get_print(rec); - - if (value != NULL) - *list = g_list_append(*list, value); + for (tmp = rec->choices; *tmp; tmp++) { + if (g_ascii_strcasecmp(*tmp, value) != 0) + *list = g_list_append(*list, g_strdup(*tmp)); + } } } }