mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Simplify cmd_ac_complete()
This commit is contained in:
parent
3d307fe341
commit
2184e92c19
@ -1171,23 +1171,17 @@ cmd_ac_remove_form_fields(DataForm* form)
|
|||||||
char*
|
char*
|
||||||
cmd_ac_complete(ProfWin* window, const char* const input, gboolean previous)
|
cmd_ac_complete(ProfWin* window, const char* const input, gboolean previous)
|
||||||
{
|
{
|
||||||
|
char *found = NULL;
|
||||||
// autocomplete command
|
// autocomplete command
|
||||||
if ((strncmp(input, "/", 1) == 0) && (!strchr(input, ' '))) {
|
if ((strncmp(input, "/", 1) == 0) && (!strchr(input, ' '))) {
|
||||||
char* found = NULL;
|
|
||||||
found = autocomplete_complete(commands_ac, input, TRUE, previous);
|
found = autocomplete_complete(commands_ac, input, TRUE, previous);
|
||||||
if (found) {
|
|
||||||
return found;
|
|
||||||
}
|
|
||||||
|
|
||||||
// autocomplete parameters
|
// autocomplete parameters
|
||||||
} else {
|
} else {
|
||||||
char* found = _cmd_ac_complete_params(window, input, previous);
|
found = _cmd_ac_complete_params(window, input, previous);
|
||||||
if (found) {
|
|
||||||
return found;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user