add -p: import Term::ReadKey with 'require'
eval{use...} is no good because the 'use' is evaluated at compile time, so manually 'require' it. We need to forward declare the functions we use, otherwise Perl raises a compilation error. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
a301973641
commit
748aa689ba
@ -40,9 +40,12 @@ my ($diff_new_color) =
|
|||||||
my $normal_color = $repo->get_color("", "reset");
|
my $normal_color = $repo->get_color("", "reset");
|
||||||
|
|
||||||
my $use_readkey = 0;
|
my $use_readkey = 0;
|
||||||
|
sub ReadMode;
|
||||||
|
sub ReadKey;
|
||||||
if ($repo->config_bool("interactive.singlekey")) {
|
if ($repo->config_bool("interactive.singlekey")) {
|
||||||
eval {
|
eval {
|
||||||
use Term::ReadKey;
|
require Term::ReadKey;
|
||||||
|
Term::ReadKey->import;
|
||||||
$use_readkey = 1;
|
$use_readkey = 1;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user