Added autocompletion for form list-single values

This commit is contained in:
James Booth
2014-09-17 22:51:52 +01:00
parent 9bfc499078
commit e42a0847a2
3 changed files with 56 additions and 0 deletions

View File

@@ -1406,6 +1406,14 @@ cmd_reset_autocomplete()
autocomplete_reset(join_property_ac);
autocomplete_reset(room_ac);
autocomplete_reset(form_ac);
if (ui_current_win_type() == WIN_MUC_CONFIG) {
ProfWin *window = wins_get_current();
if (window && window->form) {
form_reset_autocompleters(window->form);
}
}
bookmark_autocomplete_reset();
}
@@ -2130,6 +2138,14 @@ _form_autocomplete(char *input, int *size)
}
// handle list-single (set)
if ((g_strcmp0(args[0], "set") == 0) && field_type == FIELD_LIST_SINGLE) {
Autocomplete ac = form_get_value_ac(form, tag);
found = autocomplete_param_with_ac(input, size, beginning->str, ac, TRUE);
g_string_free(beginning, TRUE);
if (found != NULL) {
return found;
}
}
// handle list-multi (add, remove)