From: Steve Hancock Date: Wed, 20 Dec 2023 15:56:08 +0000 (-0800) Subject: be sure Klast is undef if Kfirst is undef X-Git-Tag: 20230912.08~6 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=aaa076fecf7c3ba03a1a5b63fdae3d8a424b8096;p=perltidy.git be sure Klast is undef if Kfirst is undef not a bug, but could be confusing when code is updated --- 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;