From c9b6914824ab3b1b0689ea62309bbe9ff603840c Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Thu, 15 Oct 2020 07:35:35 -0700 Subject: [PATCH] update AUTOLOAD to show package and version --- lib/Perl/Tidy/VerticalAligner.pm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index 79d94ecf..a6235d7f 100644 --- a/lib/Perl/Tidy/VerticalAligner.pm +++ b/lib/Perl/Tidy/VerticalAligner.pm @@ -62,9 +62,11 @@ sub AUTOLOAD { our $AUTOLOAD; return if ( $AUTOLOAD =~ /\bDESTROY$/ ); my ( $pkg, $fname, $lno ) = caller(); + my $my_package = __PACKAGE__; print STDERR <group_line_count() ); + my $rgroup_lines = $self->[_rgroup_lines_]; + return unless ( @{$rgroup_lines} ); my $group_level = $self->[_group_level_]; my $leading_space_count = $self->[_comment_leading_space_count_]; my $leading_string = $self->get_leading_string( $leading_space_count, $group_level ); - my $rgroup_lines = $self->[_rgroup_lines_]; # look for excessively long lines my $max_excess = 0; @@ -1447,7 +1449,7 @@ sub _flush_comment_lines { unless ($outdented_line_count) { $self->[_first_outdented_line_at_] = $last_outdented_line_at; } - my $nlines = $self->group_line_count(); + my $nlines = @{$rgroup_lines}; $outdented_line_count += $nlines; $self->[_outdented_line_count_] = $outdented_line_count; } @@ -1481,16 +1483,16 @@ sub _flush_group_lines { # This is the vertical aligner internal flush, which leaves the cache # intact my ($self) = @_; - return unless ( $self->group_line_count() ); my $rgroup_lines = $self->[_rgroup_lines_]; - my $group_type = $self->[_group_type_]; - my $group_level = $self->[_group_level_]; + return unless ( @{$rgroup_lines} ); + my $group_type = $self->[_group_type_]; + my $group_level = $self->[_group_level_]; # Debug 0 && do { my ( $a, $b, $c ) = caller(); - my $nlines = $self->group_line_count(); + my $nlines = @{$rgroup_lines}; print STDOUT "APPEND0: _flush_group_lines called from $a $b $c lines=$nlines, type=$group_type \n"; }; -- 2.39.5