From 7022e24bc7dfa770cc651a7afa472abe76cea894 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sun, 21 Jan 2024 18:27:47 -0800 Subject: [PATCH] fix b1465 --- dev-bin/run_convergence_tests.pl.data | 36 ++++++++++++++++++++++ dev-bin/run_convergence_tests.pl.expect | 40 ++++++++++++++++++++++--- lib/Perl/Tidy/Formatter.pm | 5 ++++ 3 files changed, 77 insertions(+), 4 deletions(-) diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index 31a9c41e..5504e62e 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -11899,6 +11899,42 @@ while ( --keyword-group-blanks-size='2.8' --keyword-group-blanks-before=2 +==> b1465.in <== +# See initialize_lp_* + +my @pics = + grep ( -f "$dir/$_" + && -s "$dir/$_" + && # Not zero byte file + !-f "$dir/$_$NO_ALBUM" + && # Don't show these + !/\Q$NOT_IMG\E$/ + && # The not_img files themselves + !/\Q$NO_ALBUM\E$/ + && # The not_img files themselves + !/\.txt$/ && # Per image captions + !/\.htaccess$/ + && # httpd security files + !/~$/ && # Emacs backup files + $_ ne +"$opt->{'index'}$HTML" + && # Index html + $_ ne $HEADER && # Header/footer + $_ ne $FOOTER + && $_ ne + $opt->{'captions'} + , # Captions file + @dir ); + + +==> b1465.par <== +--maximum-line-length=29 +--indent-columns=9 +--continuation-indentation=9 +--variable-maximum-line-length +--extended-line-up-parentheses +--ignore-side-comment-lengths + ==> b148.in <== # state 1 @yydgoto=( diff --git a/dev-bin/run_convergence_tests.pl.expect b/dev-bin/run_convergence_tests.pl.expect index 7e18b398..e7ebfbeb 100644 --- a/dev-bin/run_convergence_tests.pl.expect +++ b/dev-bin/run_convergence_tests.pl.expect @@ -7807,11 +7807,15 @@ my %distance_pref = ==> b1453 <== -my $foo = decode_json( { - foo => 'bar' } ); +my $foo = + decode_json( { + foo => 'bar' } + ); -my $foo = decode_json( { - foo => 'bar' } ); +my $foo = + decode_json( { + foo => 'bar' } + ); ==> b1454 <== my $red_color = @@ -8047,6 +8051,34 @@ while ( $^O !~ /Win32/ and sleep $config->{delay}; } +==> b1465 <== +# See initialize_lp_* + +my @pics = + grep ( -f "$dir/$_" + && -s "$dir/$_" + && # Not zero byte file + !-f "$dir/$_$NO_ALBUM" + && # Don't show these + !/\Q$NOT_IMG\E$/ + && # The not_img files themselves + !/\Q$NO_ALBUM\E$/ + && # The not_img files themselves + !/\.txt$/ && # Per image captions + !/\.htaccess$/ + && # httpd security files + !/~$/ && # Emacs backup files + $_ ne +"$opt->{'index'}$HTML" + && # Index html + $_ ne $HEADER && # Header/footer + $_ ne $FOOTER + && $_ ne + $opt->{'captions'} + , # Captions file + @dir ); + + ==> b148 <== # state 1 @yydgoto=( diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index aff0260f..711c90c8 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -28023,6 +28023,11 @@ sub get_available_spaces_to_go { $rOpts_extended_line_up_parentheses = 0; } + # fix for b1465: -vmll adds stress for -xlp + if ( $high_stress_level <= 2 && $rOpts_variable_maximum_line_length ) { + $rOpts_extended_line_up_parentheses = 0; + } + $rLP = []; # initialize the leading whitespace stack to negative levels -- 2.39.5