mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Merge pull request #1646 from MarcoPolo-PasTonMolo/fix/nick-autocomplete
Fix not autocompleting nicks with '/'
This commit is contained in:
commit
963065775b
@ -586,24 +586,28 @@ _inp_rl_tab_handler(int count, int key)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfWin* current = wins_get_current();
|
if (strncmp(rl_line_buffer, "/", 1) == 0) {
|
||||||
if ((strncmp(rl_line_buffer, "/", 1) != 0) && (current->type == WIN_MUC)) {
|
|
||||||
char* result = muc_autocomplete(current, rl_line_buffer, FALSE);
|
|
||||||
if (result) {
|
|
||||||
rl_replace_line(result, 1);
|
|
||||||
rl_point = rl_end;
|
|
||||||
free(result);
|
|
||||||
}
|
|
||||||
} else 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) {
|
||||||
rl_replace_line(result, 1);
|
rl_replace_line(result, 1);
|
||||||
rl_point = rl_end;
|
rl_point = rl_end;
|
||||||
free(result);
|
free(result);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProfWin* current = wins_get_current();
|
||||||
|
if (current->type == WIN_MUC) {
|
||||||
|
char* result = muc_autocomplete(current, rl_line_buffer, FALSE);
|
||||||
|
if (result) {
|
||||||
|
rl_replace_line(result, 1);
|
||||||
|
rl_point = rl_end;
|
||||||
|
free(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -614,17 +618,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 ((strncmp(rl_line_buffer, "/", 1) != 0) && (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;
|
||||||
}
|
}
|
||||||
} else if (strncmp(rl_line_buffer, "/", 1) == 0) {
|
}
|
||||||
ProfWin* window = wins_get_current();
|
|
||||||
char* result = cmd_ac_complete(window, rl_line_buffer, TRUE);
|
ProfWin* current = wins_get_current();
|
||||||
|
if (current->type == WIN_MUC) {
|
||||||
|
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user