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

Fix not autocompleting nicks with '/'

Remove check for '/' at the beginning of the line before autocompleting
and make it fallback to command autocompletion if no nicks found.

Fixes https://github.com/profanity-im/profanity/issues/1474
This commit is contained in:
MarcoPolo-PasTonMolo 2022-03-03 09:59:21 +02:00
parent 81b5230da5
commit 1afe2aad24

View File

@ -583,14 +583,16 @@ _inp_rl_tab_handler(int count, int key)
} }
ProfWin* current = wins_get_current(); ProfWin* current = wins_get_current();
if ((strncmp(rl_line_buffer, "/", 1) != 0) && (current->type == WIN_MUC)) { if (current->type == WIN_MUC) {
char* result = muc_autocomplete(current, rl_line_buffer, FALSE); char* result = muc_autocomplete(current, rl_line_buffer, FALSE);
if (result) { if (result) {
rl_replace_line(result, 1); rl_replace_line(result, 1);
rl_point = rl_end; rl_point = rl_end;
free(result); free(result);
} }
} else if (strncmp(rl_line_buffer, "/", 1) == 0) { }
if (strncmp(rl_line_buffer, "/", 1) == 0) {
ProfWin* window = wins_get_current(); ProfWin* window = wins_get_current();
char* result = cmd_ac_complete(window, rl_line_buffer, FALSE); char* result = cmd_ac_complete(window, rl_line_buffer, FALSE);
if (result) { if (result) {
@ -611,14 +613,16 @@ _inp_rl_shift_tab_handler(int count, int key)
} }
ProfWin* current = wins_get_current(); ProfWin* current = wins_get_current();
if ((strncmp(rl_line_buffer, "/", 1) != 0) && (current->type == WIN_MUC)) { if (current->type == WIN_MUC) {
char* result = muc_autocomplete(current, rl_line_buffer, TRUE); char* result = muc_autocomplete(current, rl_line_buffer, TRUE);
if (result) { if (result) {
rl_replace_line(result, 1); rl_replace_line(result, 1);
rl_point = rl_end; rl_point = rl_end;
free(result); free(result);
} }
} else if (strncmp(rl_line_buffer, "/", 1) == 0) { }
if (strncmp(rl_line_buffer, "/", 1) == 0) {
ProfWin* window = wins_get_current(); ProfWin* window = wins_get_current();
char* result = cmd_ac_complete(window, rl_line_buffer, TRUE); char* result = cmd_ac_complete(window, rl_line_buffer, TRUE);
if (result) { if (result) {