mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Implemented autocomplete for /connect properties
This commit is contained in:
parent
168cb0e557
commit
b32ba75db5
@ -1639,18 +1639,24 @@ _connect_autocomplete(char *input, int *size)
|
|||||||
{
|
{
|
||||||
char *result = NULL;
|
char *result = NULL;
|
||||||
|
|
||||||
// input[*size] = '\0';
|
input[*size] = '\0';
|
||||||
// gchar **args = parse_args(input, 3, 3);
|
gchar **args = parse_args(input, 2, 4);
|
||||||
|
|
||||||
// if ((strncmp(input, "/account set", 12) == 0) && (args != NULL)) {
|
if ((strncmp(input, "/connect", 8) == 0) && (args != NULL)) {
|
||||||
// GString *beginning = g_string_new("/account set ");
|
GString *beginning = g_string_new("/connect ");
|
||||||
// g_string_append(beginning, args[1]);
|
g_string_append(beginning, args[0]);
|
||||||
// result = autocomplete_param_with_ac(input, size, beginning->str, account_set_ac);
|
if (args[1] != NULL && args[2] != NULL) {
|
||||||
// g_string_free(beginning, TRUE);
|
g_string_append(beginning, " ");
|
||||||
// if (result != NULL) {
|
g_string_append(beginning, args[1]);
|
||||||
// return result;
|
g_string_append(beginning, " ");
|
||||||
// }
|
g_string_append(beginning, args[2]);
|
||||||
// }
|
}
|
||||||
|
result = autocomplete_param_with_ac(input, size, beginning->str, connect_property_ac);
|
||||||
|
g_string_free(beginning, TRUE);
|
||||||
|
if (result != NULL) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
result = autocomplete_param_with_func(input, size, "/connect", accounts_find_enabled);
|
result = autocomplete_param_with_func(input, size, "/connect", accounts_find_enabled);
|
||||||
if (result != NULL) {
|
if (result != NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user