From: Steve Hancock Date: Tue, 30 Mar 2021 00:18:50 +0000 (-0700) Subject: Fix conflict between -wba='||' and -opr X-Git-Tag: 20210402~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6921a7d28cb94a842597aa41b9cd90d68e6207d5;p=perltidy.git Fix conflict between -wba='||' and -opr --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 2c2a8ba9..f6f68bb1 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -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] ) diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index 6795b6be..3b9f68f1 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,6 +2,29 @@ =over 4 +=item B + +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 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