From: Steve Hancock Date: Wed, 23 Aug 2023 18:37:50 +0000 (-0700) Subject: fix b1459, edge of stability issue for -xlp X-Git-Tag: 20230701.03~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5ec409bf4738821e207fbc816a13ef62fc860324;p=perltidy.git fix b1459, edge of stability issue for -xlp --- diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index 0b804bb5..18e6388a 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -11685,6 +11685,58 @@ BEGIN { --want-trailing-commas='b' --delete-trailing-commas +==> b1459.in <== +# S1 +my @pics= + grep( -f "$dir/$_" + &&-s "$dir/$_" + &&! + -f "$dir/$_$NO_ALBUM" + &&!/\Q$NOT_IMG\E$/ + &&!/\Q$NO_ALBUM\E$/ + &&!/\.txt$/ + &&!/\.htaccess$/ + &&!/~$/ + &&$_ ne + "$opt->{'index'}$HTML" + &&$_ ne $HEADER + &&$_ ne $FOOTER + && + + $_ ne$opt->{ + 'captions'}, + @dir ) ; + +#S2 +my @pics= + grep( -f "$dir/$_" + &&-s "$dir/$_" + &&! + -f "$dir/$_$NO_ALBUM" + &&!/\Q$NOT_IMG\E$/ + &&!/\Q$NO_ALBUM\E$/ + &&!/\.txt$/ + &&!/\.htaccess$/ + &&!/~$/ + &&$_ ne +"$opt->{'index'}$HTML" + &&$_ ne $HEADER + &&$_ ne $FOOTER + && + + $_ ne + $opt->{'captions'}, + @dir ) ; + + +==> b1459.par <== +--maximum-line-length=25 +--indent-columns=3 +--continuation-indentation=1 +--noadd-whitespace +--extended-continuation-indentation +--extended-line-up-parentheses + ==> b146.in <== # State 1 diff --git a/dev-bin/run_convergence_tests.pl.expect b/dev-bin/run_convergence_tests.pl.expect index 8f81fc69..5a8ec0e0 100644 --- a/dev-bin/run_convergence_tests.pl.expect +++ b/dev-bin/run_convergence_tests.pl.expect @@ -7912,6 +7912,50 @@ BEGIN { @{ $me->{'mail_hdr_list'} }, ); +==> b1459 <== +# S1 +my @pics= + grep( -f "$dir/$_" + &&-s "$dir/$_" + &&! + -f "$dir/$_$NO_ALBUM" + &&!/\Q$NOT_IMG\E$/ + &&!/\Q$NO_ALBUM\E$/ + &&!/\.txt$/ + &&!/\.htaccess$/ + &&!/~$/ + &&$_ ne +"$opt->{'index'}$HTML" + &&$_ ne $HEADER + &&$_ ne $FOOTER + && + + $_ ne$opt->{ + 'captions'}, + @dir ) ; + +#S2 +my @pics= + grep( -f "$dir/$_" + &&-s "$dir/$_" + &&! + -f "$dir/$_$NO_ALBUM" + &&!/\Q$NOT_IMG\E$/ + &&!/\Q$NO_ALBUM\E$/ + &&!/\.txt$/ + &&!/\.htaccess$/ + &&!/~$/ + &&$_ ne +"$opt->{'index'}$HTML" + &&$_ ne $HEADER + &&$_ ne $FOOTER + && + + $_ ne$opt->{ + 'captions'}, + @dir ) ; + + ==> b146 <== # State 1 diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 4f51f9fc..c950b0bb 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -25604,6 +25604,11 @@ sub get_available_spaces_to_go { $rOpts_extended_line_up_parentheses = 0; } + # fix for b1459: -naws adds stress for -xlp + if ( $high_stress_level <= 2 && !$rOpts_add_whitespace ) { + $rOpts_extended_line_up_parentheses = 0; + } + $rLP = []; # initialize the leading whitespace stack to negative levels