about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-09-17 22:51:52 +0100
committerJames Booth <boothj5@gmail.com>2014-09-17 22:51:52 +0100
commite42a0847a2d59c5eba93e36ce7c6d1b7275dd621 (patch)
treed263e91039180431d207b9f40eb319c22fcaff4e /src/command
parent9bfc499078adb040f27fb7e9bdfcd878e9e173d2 (diff)
downloadprofani-tty-e42a0847a2d59c5eba93e36ce7c6d1b7275dd621.tar.gz
Added autocompletion for form list-single values
Diffstat (limited to 'src/command')
-rw-r--r--src/command/command.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/command/command.c b/src/command/command.c
index 0e6a6156..4c245c87 100644
--- a/src/command/command.c
+++ b/src/command/command.c
@@ -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)