From: Steve Hancock Date: Tue, 11 Jun 2024 20:07:06 +0000 (-0700) Subject: fix c375 X-Git-Tag: 20240511.04~8 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8f4a08e52673d2561c5bec9e7ccb127088bee7ef;p=perltidy.git fix c375 --- diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index b7f8da49..79236b5f 100644 --- a/lib/Perl/Tidy/VerticalAligner.pm +++ b/lib/Perl/Tidy/VerticalAligner.pm @@ -5526,9 +5526,15 @@ sub pad_signed_number_columns { my $old_col = $columns[$jcol]; my $col = $alignment->{column}; - # only do this if the text has a leading digit - if ( $col < $old_col - && $rfields->[$jcol] =~ /^[+-]?\d/ ) + if ( + $col < $old_col + + # only do this if the text has a leading digit + && $rfields->[$jcol] =~ /^([+-]?)\d/ + + # and a signed number has been seen - issue c375 + && ( $1 || $column_info{$jcol}->{signed_count} ) + ) { my $spaces_needed = $old_col - $col; my $spaces_available =