1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Reverse priority for nick vs cmd autocomplete

This commit is contained in:
MarcoPolo-PasTonMolo 2022-03-20 16:16:44 +02:00
parent 1afe2aad24
commit ffeb8c33f1

View File

@ -582,6 +582,17 @@ _inp_rl_tab_handler(int count, int key)
return 0; return 0;
} }
if (strncmp(rl_line_buffer, "/", 1) == 0) {
ProfWin* window = wins_get_current();
char* result = cmd_ac_complete(window, rl_line_buffer, FALSE);
if (result) {
rl_replace_line(result, 1);
rl_point = rl_end;
free(result);
return 0;
}
}
ProfWin* current = wins_get_current(); ProfWin* current = wins_get_current();
if (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);
@ -592,15 +603,6 @@ _inp_rl_tab_handler(int count, int key)
} }
} }
if (strncmp(rl_line_buffer, "/", 1) == 0) {
ProfWin* window = wins_get_current();
char* result = cmd_ac_complete(window, rl_line_buffer, FALSE);
if (result) {
rl_replace_line(result, 1);
rl_point = rl_end;
free(result);
}
}
return 0; return 0;
} }
@ -612,19 +614,20 @@ _inp_rl_shift_tab_handler(int count, int key)
return 0; return 0;
} }
ProfWin* current = wins_get_current(); if (strncmp(rl_line_buffer, "/", 1) == 0) {
if (current->type == WIN_MUC) { ProfWin* window = wins_get_current();
char* result = muc_autocomplete(current, rl_line_buffer, TRUE); char* result = cmd_ac_complete(window, 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);
return 0;
} }
} }
if (strncmp(rl_line_buffer, "/", 1) == 0) { ProfWin* current = wins_get_current();
ProfWin* window = wins_get_current(); if (current->type == WIN_MUC) {
char* result = cmd_ac_complete(window, 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;