]> git.donarmstrong.com Git - perltidy.git/commitdiff
Fix conflict between -wba='||' and -opr
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 30 Mar 2021 00:18:50 +0000 (17:18 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 30 Mar 2021 00:18:50 +0000 (17:18 -0700)
lib/Perl/Tidy/Formatter.pm
local-docs/BugLog.pod

index 2c2a8ba909e161e59b030afa6904d6f770383ed7..f6f68bb1a3b0bc1a6dcdd9edff9444bc2a5427a5 100644 (file)
@@ -20973,6 +20973,10 @@ sub set_vertical_tightness_flags {
                 || $iend_next == $ibeg_next + 2
                 && $types_to_go[$iend_next] eq '#' )
 
+            # Fix for case b1060 when both -baoo and -otr are set:
+            # to avoid blinking, honor the -baoo flag over the -otr flag.
+            && $token_end ne '||' && $token_end ne '&&'
+
             # looks bad if we align vertically with the wrong container
             && $tokens_to_go[$ibeg] ne $tokens_to_go[$ibeg_next]
           )
index 6795b6be907b854dc66659d0af33ed00a300bfe7..3b9f68f111f641ca02118187fdc6bb010e1fb2f5 100644 (file)
@@ -2,6 +2,29 @@
 
 =over 4
 
+=item B<Fix conflict between -wba='||' and -opr>
+
+Random testing produced a problem with convergence due to a conflict
+between two parameters for the following code
+
+    my $lxy =
+      ( @$cx - @$cy ) ||
+      (
+        length ( int ( $cx->[-1] ) ) -
+        length ( int ( $cy->[-1] ) ) );
+
+when using these parameters
+
+    --break-after-all-operators
+    --maximum-line-length=61
+    --opening-paren-right
+
+Both the '||' and the '(' want to be at the end of a line according to the
+parameters.  The problem is resolved by giving priority to the '||'.  This
+fixes case b1060.
+
+29 Mar 2021
+
 =item B<Follow user requests better to break before operators>
 
 Random testing produced some cases in which user requests to break before selected
@@ -21,7 +44,7 @@ operators were not being followed.  For example
 
 This fixes case b1054.
 
-28 Mar 2021.
+28 Mar 2021, 94f0877.
 
 =item B<Fix problems with combinations of -iob -lp>