From edd1e41453e955093bb47b44f7b6dee552f23931 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sun, 7 Nov 2021 15:21:30 -0800 Subject: [PATCH] fix issue b1239, rare instability --- dev-bin/run_convergence_tests.pl.data | 20 ++++++++++++++++++++ lib/Perl/Tidy/Formatter.pm | 6 ++++++ local-docs/BugLog.pod | 4 ++-- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index cb9a057d..f79e19b0 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -7991,6 +7991,26 @@ is( --paren-vertical-tightness-closing=1 --variable-maximum-line-length +==> b1239.in <== +# S1 +( + sockaddr_in( getsockname ( $_[0]->[_SOCKET] ) ) +)[0]; + +# S2 +( sockaddr_in( getsockname ( $_[0]->[_SOCKET] ) ) +)[0]; + +==> b1239.par <== +--continuation-indentation=10 +--indent-columns=0 +--line-up-parentheses +--maximum-line-length=54 +--paren-vertical-tightness-closing=2 +--paren-vertical-tightness=1 +--space-keyword-paren +--weld-nested-containers + ==> b131.in <== unless ( open( SCORE, "+>>$Score_File" ) ) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 3c85cf38..3a9a7021 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -8618,6 +8618,12 @@ EOM } } ## end starting new weld sequence + else { + + # set the 1-line flag if continuing a weld sequence; fixes b1239 + $is_one_line_weld = ( $iline_oo == $iline_oc ); + } + # DO-NOT-WELD RULE 2: # Do not weld an opening paren to an inner one line brace block # We will just use old line numbers for this test and require diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index 2b4820f1..d3bd2fd6 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -64,7 +64,7 @@ This has been fixed. do $roff ( &verify($tpage) ); -20 Oct 2021. +20 Oct 2021, 72e4bb1. =item B @@ -77,7 +77,7 @@ had empty strings as block names. This was fixed in two ways. First, the regex was fixed so that it cannot match an empty string. Second, a test for an empty string was added. -20 Oct 2021. +20 Oct 2021, aa1a019. =item B -- 2.39.5