about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-10-19 00:34:09 +0100
committerJames Booth <boothj5@gmail.com>2014-10-19 00:34:09 +0100
commitf1097daaa3bf3d138bf49874b56b3baafb5c3917 (patch)
tree4eeba400d746ada0a9e4708ec146be01a5ae736f /src
parent5818fbe7bb8a6b96ab92cc2d3f18a6eb4c494771 (diff)
downloadprofani-tty-f1097daaa3bf3d138bf49874b56b3baafb5c3917.tar.gz
Added autocomplete for /field list-single types
Diffstat (limited to 'src')
-rw-r--r--src/command/command.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/command/command.c b/src/command/command.c
index d5835ddf..2acfb2dc 100644
--- a/src/command/command.c
+++ b/src/command/command.c
@@ -2295,6 +2295,7 @@ _form_autocomplete(char *input, int *size)
                     char *field_tag = split[0]+1;
                     if (form_tag_exists(form, field_tag)) {
                         form_field_type_t field_type = form_get_field_type(form, field_tag);
+                        Autocomplete ac = NULL;
 
                         switch (field_type)
                         {
@@ -2302,16 +2303,19 @@ _form_autocomplete(char *input, int *size)
                                 found = autocomplete_param_with_func(input, size, split[0],
                                     prefs_autocomplete_boolean_choice);
                                 break;
+                            case FIELD_LIST_SINGLE:
+                                ac = form_get_value_ac(form, field_tag);
+                                found = autocomplete_param_with_ac(input, size, split[0], ac, TRUE);
+                                break;
                             default:
                                 break;
                         }
-
-                        if (found) {
-                            return found;
-                        }
                     }
                 }
-
+                g_strfreev(split);
+                if (found) {
+                    return found;
+                }
             } else {
                 found = autocomplete_param_with_ac(input, size, "/form", form_ac, TRUE);
                 if (found != NULL) {