Cleanup: use subroutine signatures, remove deprecated methods.
The signatures feature has been "experimental" since Perl 5.20 (May 2014), but expected to stay. After 8 years I'm ready to take the risk :) Have added Perl v5.28 (June 2018) as the minimum requirement, even though the current revbank should work with 5.20, to see if this bothers any users. Perl v5.28 is in Debian "buster", which is now oldstable.
This commit is contained in:
parent
1661661ffd
commit
eed0db7897
45 changed files with 233 additions and 444 deletions
37
plugins/idle
37
plugins/idle
|
@ -2,28 +2,27 @@
|
|||
|
||||
my $timeout = 10;
|
||||
|
||||
sub hook_prompt_idle {
|
||||
my ($class, $cart, $plugin, $seconds, $readline) = @_;
|
||||
if ($seconds >= $timeout and $cart->size and not $plugin) {
|
||||
call_hooks("beep");
|
||||
sub hook_prompt_idle($class, $cart, $plugin, $seconds, $readline, @) {
|
||||
return unless $seconds >= $timeout and $cart->size and not $plugin;
|
||||
|
||||
return if $seconds > $timeout; # text only once
|
||||
call_hooks("beep");
|
||||
|
||||
my $text = $readline->copy_text;
|
||||
my $point = $readline->{point};
|
||||
return if $seconds > $timeout; # text only once
|
||||
|
||||
$readline->save_prompt;
|
||||
$readline->replace_line("");
|
||||
$readline->redisplay;
|
||||
my $text = $readline->copy_text;
|
||||
my $point = $readline->{point};
|
||||
|
||||
my $help = $cart->entries('refuse_checkout')
|
||||
? "Enter 'abort' to abort."
|
||||
: "Enter username to pay/finish or 'abort' to abort.";
|
||||
print "\e[33;2;1mTransaction incomplete.\e[0m $help\n";
|
||||
$readline->save_prompt;
|
||||
$readline->replace_line("");
|
||||
$readline->redisplay;
|
||||
|
||||
$readline->restore_prompt;
|
||||
$readline->replace_line($text);
|
||||
$readline->{point} = $point;
|
||||
$readline->redisplay;
|
||||
}
|
||||
my $help = $cart->entries('refuse_checkout')
|
||||
? "Enter 'abort' to abort."
|
||||
: "Enter username to pay/finish or 'abort' to abort.";
|
||||
print "\e[33;2;1mTransaction incomplete.\e[0m $help\n";
|
||||
|
||||
$readline->restore_prompt;
|
||||
$readline->replace_line($text);
|
||||
$readline->{point} = $point;
|
||||
$readline->redisplay;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue