From aaa076fecf7c3ba03a1a5b63fdae3d8a424b8096 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Wed, 20 Dec 2023 07:56:08 -0800 Subject: [PATCH] be sure Klast is undef if Kfirst is undef not a bug, but could be confusing when code is updated --- lib/Perl/Tidy/Formatter.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index d6f00b03..507c146a 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -6070,7 +6070,7 @@ EOM my $tee_output; my $Klimit = $self->[_Klimit_]; - my $Kfirst; + my ( $Kfirst, $Klast ); # Handle line of non-code if ( $line_type ne 'CODE' ) { @@ -6103,6 +6103,7 @@ EOM # update Klimit for added tokens $Klimit = @{$rLL} - 1; + $Klast = $Klimit; } ## end if ( $jmax >= 0 ) else { @@ -6130,7 +6131,7 @@ EOM } ## end if ( $line_type eq 'CODE') # Finish storing line variables - $line_of_tokens->{_rK_range} = [ $Kfirst, $Klimit ]; + $line_of_tokens->{_rK_range} = [ $Kfirst, $Klast ]; $self->[_Klimit_] = $Klimit; my $rlines = $self->[_rlines_]; push @{$rlines}, $line_of_tokens; -- 2.39.5