]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix log file line number as noted in git #81
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 13 Jan 2022 14:36:58 +0000 (06:36 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 13 Jan 2022 14:36:58 +0000 (06:36 -0800)
lib/Perl/Tidy/VerticalAligner.pm

index 2eb1e6cbf43081c75d4b2a3ea33d0aa614e08045..17e429bf3a6983a9bc700b378f8be2feef6fccc3 100644 (file)
@@ -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;
     }