From adb20963af804ddd7c9e9953f55d6b41ff22fc1e Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sun, 13 Sep 2020 15:46:59 -0700 Subject: [PATCH] fixed unitialized variable problem --- lib/Perl/Tidy/Formatter.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 2cba7e0c..06136cb9 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -11922,7 +11922,12 @@ sub lookup_opening_indentation { # handle option to indent non-blocks of the form ); }; ]; # But don't do special indentation to something like ')->pack(' if ( !$block_type_to_go[$ibeg] ) { - my $cti = $closing_token_indentation{ $tokens_to_go[$ibeg] }; + + # Note that logical padding has already been applied, so we may + # need to remove some spaces to get a valid hash key. + my $tok = $tokens_to_go[$ibeg]; + if ( length($tok) > 1 ) { $tok =~ s/\s//g } + my $cti = $closing_token_indentation{ $tok }; if ( $cti == 1 ) { if ( $i_terminal <= $ibeg + 1 || $is_semicolon_terminated ) -- 2.39.5