From 06d4591e8ac9e32a8b2196f0a7a2bd393b93529d Mon Sep 17 00:00:00 2001
From: Juerd Waalboer <juerd@tnx.nl>
Date: Wed, 22 Feb 2023 01:36:06 +0100
Subject: [PATCH] Fix tab completion bug

When there were several matches that shared the same common prefix, but
with a different case, readline would eat the input from the case
sensitive longest common prefix up to where the case began to differ.

e.g. when "ibutton" and "iButton-touwtje" were available, typing
"ibu<tab>" would truncate the input to just "i" and on second tab show
both matches, but without ever completing beyond the "i".
---
 revbank | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/revbank b/revbank
index 0d664cd..6e8d15e 100755
--- a/revbank
+++ b/revbank
@@ -67,6 +67,10 @@ sub prompt($prompt, $plugins, $completions) {
         return shift @matches;
     };
 
+    # Term::ReadLine::Gnu (1.37) does not expose rl_completion_case_fold,
+    # but it can be assigned through the corresponding .inputrc command.
+    $readline->parse_and_bind("set completion-ignore-case on");
+
     my $done;
     my $input;