1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Simplify cmd_ac_complete()

This commit is contained in:
Michael Vetter 2020-11-05 09:24:17 +01:00
parent 3d307fe341
commit 2184e92c19

View File

@ -1171,23 +1171,17 @@ cmd_ac_remove_form_fields(DataForm* form)
char*
cmd_ac_complete(ProfWin* window, const char* const input, gboolean previous)
{
char *found = NULL;
// autocomplete command
if ((strncmp(input, "/", 1) == 0) && (!strchr(input, ' '))) {
char* found = NULL;
found = autocomplete_complete(commands_ac, input, TRUE, previous);
if (found) {
return found;
}
// autocomplete parameters
} else {
char* found = _cmd_ac_complete_params(window, input, previous);
if (found) {
return found;
}
found = _cmd_ac_complete_params(window, input, previous);
}
return NULL;
return found;
}
void