From: Steve Hancock Date: Thu, 13 Jan 2022 14:36:58 +0000 (-0800) Subject: fix log file line number as noted in git #81 X-Git-Tag: 20211029.06~21 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=86759bef7e912176d96ee13094e3c3fc780f14df;p=perltidy.git fix log file line number as noted in git #81 --- diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index 2eb1e6cb..17e429bf 100644 --- a/lib/Perl/Tidy/VerticalAligner.pm +++ b/lib/Perl/Tidy/VerticalAligner.pm @@ -1437,12 +1437,13 @@ sub _flush_comment_lines { my $file_writer_object = $self->[_file_writer_object_]; my $last_outdented_line_at = $file_writer_object->get_output_line_number(); - $self->[_last_outdented_line_at_] = $last_outdented_line_at; + my $nlines = @{$rgroup_lines}; + $self->[_last_outdented_line_at_] = + $last_outdented_line_at + $nlines - 1; my $outdented_line_count = $self->[_outdented_line_count_]; unless ($outdented_line_count) { $self->[_first_outdented_line_at_] = $last_outdented_line_at; } - my $nlines = @{$rgroup_lines}; $outdented_line_count += $nlines; $self->[_outdented_line_count_] = $outdented_line_count; }