From 129080382cd436bf5250bc40317faf51c75f5d4f Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Wed, 29 Apr 2020 07:34:40 -0700 Subject: [PATCH] fix -spp to work with anonymous subs --- lib/Perl/Tidy/Formatter.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index ed62ff29..37ccd800 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -2763,7 +2763,6 @@ sub respace_tokens { my ( $token_pp, $type_pp ); - #my $Kpp = $K_previous_nonblank->($Kp); my $Kpp = $self->K_previous_nonblank($Kp); if ( defined($Kpp) ) { $token_pp = $rLL->[$Kpp]->[_TOKEN_]; @@ -2925,7 +2924,7 @@ sub respace_tokens { next; } - if ( $token =~ /$SUB_PATTERN/ ) { + if ( $token =~ /$ANYSUB_PATTERN/ ) { # -spp = 0 : no space before opening prototype paren # -spp = 1 : stable (follow input spacing) -- 2.39.5