From d1b80bf864be7284b4fe4440554506209b93fe5c Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Thu, 15 Dec 2022 11:32:06 -0800 Subject: [PATCH] fix b1441 --- dev-bin/run_convergence_tests.pl.data | 20 ++++++++++++++++++++ lib/Perl/Tidy/Formatter.pm | 9 ++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index 2a69cf09..40891265 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -11220,6 +11220,26 @@ $last = after ( --opening-paren-right --variable-maximum-line-length +==> b1441.in <== + my $my_handler = + new XML::Handler::YAWriter ( + 'Output' => $fileHandler, + + ); + + my $my_handler = + new XML::Handler::YAWriter ( 'Output' => $fileHandler, + + ); + + +==> b1441.par <== +--continuation-indentation=3 +--extended-line-up-parentheses +--maximum-line-length=61 +--paren-vertical-tightness=1 +--space-function-paren + ==> b146.in <== # State 1 diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 8df1c1ef..9d523fa8 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -12804,9 +12804,16 @@ sub xlp_collapsed_lengths { } } + #-------------------------------------------------- + # This block is deactivated to fix b1441. It is not + # needed now because the comma length is added later, + # and including it twice can cause instability. + # This block can eventually be removed. + #-------------------------------------------------- # Include length to a comma ending this line # note: any side comments are handled at loop end (b1332) - if ( $interrupted_list_rule + if ( 0 + && $interrupted_list_rule && $rLL->[$K_terminal]->[_TYPE_] eq ',' ) { my $Kend = $K_terminal; -- 2.39.5