]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix sort of line numbers for error output
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 4 Apr 2024 01:09:04 +0000 (18:09 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 4 Apr 2024 01:09:04 +0000 (18:09 -0700)
lib/Perl/Tidy/Formatter.pm

index 689bcb263e916450f6ba95ecd5bb12744fa6ece5..70c21f6254bcece5d5f33ed1d9ae2347c1002ef8 100644 (file)
@@ -14307,7 +14307,8 @@ sub stringify_line_range {
     my ($rcalls) = @_;
     my $string = EMPTY_STRING;
     if ( $rcalls && @{$rcalls} ) {
-        my @sorted  = sort { $a <=> $b } @{$rcalls};
+        my @sorted =
+          sort { $a->{line_number} <=> $b->{line_number} } @{$rcalls};
         my $num     = @sorted;
         my $lno_beg = $sorted[0]->{line_number};
         my $lno_end = $sorted[-1]->{line_number};