From 8f4a08e52673d2561c5bec9e7ccb127088bee7ef Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Tue, 11 Jun 2024 13:07:06 -0700 Subject: [PATCH] fix c375 --- lib/Perl/Tidy/VerticalAligner.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 = -- 2.39.5