]> git.donarmstrong.com Git - perltidy.git/commitdiff
Modify welding rules for -lp
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 21 May 2021 18:06:23 +0000 (11:06 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 21 May 2021 18:06:23 +0000 (11:06 -0700)
lib/Perl/Tidy/Formatter.pm
local-docs/BugLog.pod

index 27db51b9f5b538075b23b816d897742556775874..29b1e8944de427a88956c9bb729c62eea9769631 100644 (file)
@@ -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 )
                     {
index 840a674348548ba68a01d1459f36daec1ff5390d..1b856f37430d1f67d5fe7e551b4e2dfadc3d11c0 100644 (file)
@@ -2,6 +2,15 @@
 
 =over 4
 
+=item B<Modify welding rules>
+
+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<Fix inconsistency involving counting commas>
 
 Random testing produced a formatting instability involving the combination of