From: Steve Hancock Date: Fri, 2 Dec 2022 16:53:39 +0000 (-0800) Subject: fix b1440 X-Git-Tag: 20221112.01~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f90ca154cd04bc083065301ff3221cfc9485f822;p=perltidy.git fix b1440 --- diff --git a/dev-bin/perltidy_random_setup.pl b/dev-bin/perltidy_random_setup.pl index 5f2c6103..eda1deda 100755 --- a/dev-bin/perltidy_random_setup.pl +++ b/dev-bin/perltidy_random_setup.pl @@ -1225,6 +1225,9 @@ EOM backup-file-extension backup-method character-encoding + dump-block-summary + dump-block-types + dump-block-minimum-lines dump-cuddled-block-list dump-defaults dump-long-names diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index 662496d7..2a69cf09 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -11199,6 +11199,27 @@ $last = after ( --keep-old-breakpoints-after='-' --want-break-before='-' +==> b1440.in <== + $comp = ( $form->[3] ? ( + $im3->dummy( 0, 3 ) > 0 ) * + 255 : + ( $im3 > 0 ) ); + + $comp = + ( $form->[3] ? + ( + $im3->dummy( 0, 3 ) > 0 ) * + 255 : + ( $im3 > 0 ) ); + +==> b1440.par <== +--break-after-all-operators +--continuation-indentation=6 +--keep-old-breakpoints-after='?' +--maximum-line-length=29 +--opening-paren-right +--variable-maximum-line-length + ==> b146.in <== # State 1 diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index d3b1d494..e05f681c 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -2436,11 +2436,12 @@ EOM # Ignore kbb='(' and '[' and '{': can cause unstable math formatting # (issues b1346, b1347, b1348) and likewise ignore kba=')' and ']' and '}' + # Also always ignore ? and : (b1440 and b1433-b1439) if ( $short_name eq 'kbb' ) { - @list = grep { !m/[\(\[\{]/ } @list; + @list = grep { !m/[\(\[\{\?\:]/ } @list; } elsif ( $short_name eq 'kba' ) { - @list = grep { !m/[\)\]\}]/ } @list; + @list = grep { !m/[\)\]\}\?\:]/ } @list; } # pull out any any leading container code, like f( or *{