From 6c74097707c4b47b37b32f1b6b146dc80cd492b7 Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Thu, 25 Apr 2024 01:05:38 +0200 Subject: [PATCH] v6.1.2: fix retry prompt Broken since 2b0f8feb. --- lib/RevBank/Prompt.pm | 9 +++++---- revbank | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/RevBank/Prompt.pm b/lib/RevBank/Prompt.pm index fc5aa17..a27be54 100755 --- a/lib/RevBank/Prompt.pm +++ b/lib/RevBank/Prompt.pm @@ -84,9 +84,6 @@ sub prompt($prompt, $completions = [], $default = "", $pos = 0, $cart = undef, $ # but it can be assigned through the corresponding .inputrc command. $readline->parse_and_bind("set completion-ignore-case on"); - $readline->insert_text($default); - $readline->Attribs->{point} = $pos; - my $begin = my $time = time; $readline->Attribs->{event_hook} = sub { @@ -109,8 +106,12 @@ sub prompt($prompt, $completions = [], $default = "", $pos = 0, $cart = undef, $ } }; + $readline->Attribs->{startup_hook} = sub { + $readline->Attribs->{point} = $pos; + }; + $readline->ornaments(0); - my $input = $readline->readline($prompt); + my $input = $readline->readline($prompt, $default); print "\e[0m"; diff --git a/revbank b/revbank index cad0eb2..78e9028 100755 --- a/revbank +++ b/revbank @@ -16,7 +16,7 @@ use RevBank::Messages; use RevBank::Cart; use RevBank::Prompt; -our $VERSION = "6.1.1"; +our $VERSION = "6.1.2"; our %HELP1 = ( "abort" => "Abort the current transaction", );