From 6d0c97895a209df1dced12a8c22548a121fa5c20 Mon Sep 17 00:00:00 2001 From: CismonX Date: Mon, 13 Mar 2023 16:47:50 +0800 Subject: [PATCH] feat: hack completion display always show all candidates as if show-all-if-ambiguous is on --- doc/arif.texi | 2 -- src/arif_rl.c | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/arif.texi b/doc/arif.texi index 3ce77c9..9edf6a6 100644 --- a/doc/arif.texi +++ b/doc/arif.texi @@ -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 diff --git a/src/arif_rl.c b/src/arif_rl.c index 9030e87..9163c86 100644 --- a/src/arif_rl.c +++ b/src/arif_rl.c @@ -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;