From a4ec4c16de903bff9742c5afb02252a4298a6c89 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Fri, 21 May 2021 11:06:23 -0700 Subject: [PATCH] Modify welding rules for -lp --- lib/Perl/Tidy/Formatter.pm | 5 +++-- local-docs/BugLog.pod | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 27db51b9..29b1e894 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -7622,8 +7622,9 @@ EOM # this line has an unbalanced start. This helps prevent # blinkers in unusual cases for lines near the length limit # by making it more likely that RULE 2 will prevent a weld. - my $level_diff = - $outer_opening->[_LEVEL_] - $rLL->[$Kfirst]->[_LEVEL_]; + # FIX3: for b1131: only use level difference in -lp mode. + my $level_diff = $rOpts_line_up_parentheses + && $outer_opening->[_LEVEL_] - $rLL->[$Kfirst]->[_LEVEL_]; if ( !$level_diff || $excess + $rOpts_indent_columns <= 0 ) { diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index 840a6743..1b856f37 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,6 +2,15 @@ =over 4 +=item B + +This is an update to the patch 19 Apr 2021, eeeaf09. It restricts that patch +to -lp formatting mode. + +This fixes case b1131. + +21 May 2021. + =item B Random testing produced a formatting instability involving the combination of -- 2.39.5