From: Steve Hancock Date: Thu, 4 Apr 2024 01:09:04 +0000 (-0700) Subject: fix sort of line numbers for error output X-Git-Tag: 20240202.04~4 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3a2fdc1609643c4c364fa993dc5228122c2da282;p=perltidy.git fix sort of line numbers for error output --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 689bcb26..70c21f62 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -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};