From: Steve Hancock Date: Fri, 12 Feb 2021 15:56:01 +0000 (-0800) Subject: Define left side bond strengths for unary plus and minus X-Git-Tag: 20210402~51 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=58a7895c9b47b059a5b4bdea6a2331831c61c20f;p=perltidy.git Define left side bond strengths for unary plus and minus --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 5a1c86b7..16ef050f 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -2879,6 +2879,10 @@ EOM @right_bond_strength{@q} = ( 0.91 * NOMINAL + 0.09 * WEAK ) x scalar(@q); + # Define left strength of unary plus and minus (fixes case b511) + $left_bond_strength{p} = $left_bond_strength{'+'}; + $left_bond_strength{m} = $left_bond_strength{'-'}; + # breaking BEFORE these is just ok: @q = qw# >> << #; @right_bond_strength{@q} = (STRONG) x scalar(@q); diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index c47dba66..5def8e90 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,6 +2,14 @@ =over 4 +=item B + +Random testing produced a blinking state which was traced to the unary plus not +having a defined strength in the line break algorithm. This was fixed by +setting it to be the same as the left strength of a plus. This fixes case +b511. +12 Feb 2021. + =item B Random testing produced some blinking cases which were related to