feat: hack completion display

always show all candidates as if show-all-if-ambiguous is on
This commit is contained in:
CismonX 2023-03-13 16:47:50 +08:00
parent e3adac852c
commit 6d0c97895a
Signed by: cismonx
GPG Key ID: 3094873E29A482FB
2 changed files with 6 additions and 2 deletions

View File

@ -274,8 +274,6 @@ configure the key bindings from a Readline init file.
Here is an example @code{~/.inputrc} snippet:
@example
set show-all-if-ambiguous on
"\e ": arify-toggle
"\e\b": arify-next-engine
"\e[5;3~": arify-page-up # M-PgUp

View File

@ -108,6 +108,12 @@ arif_rl_complete(
assert(match != NULL);
match[0] = '\0';
comp_list[0] = match;
// This hack ensures that candidates are always displayed,
// even without `show-all-if-ambiguous` on.
if (rl_completion_type == TAB) {
arif_rl_display(ctx, NULL, num, 0);
}
}
return comp_list;