From: Steve Hancock Date: Fri, 22 Jul 2022 06:04:53 +0000 (-0700) Subject: improve some line breaks X-Git-Tag: 20220613.03~10 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=55aa969336da8018fc0b774f6d9b59f0b5c60872;p=perltidy.git improve some line breaks --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 8f160453..c09eb585 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -3909,6 +3909,9 @@ EOM # $a->$b($c); $binary_bond_strength{'i'}{'->'} = 1.45 * STRONG; + # Added for c140 to make 'w ->' and 'i ->' behave the same + $binary_bond_strength{'w'}{'->'} = 1.45 * STRONG; + # Note that the following alternative strength would make the break at the # '->' rather than opening the '('. Both have advantages and disadvantages. # $binary_bond_strength{'i'}{'->'} = 0.5*STRONG + 0.5 * NOMINAL; # @@ -4354,7 +4357,8 @@ EOM elsif ( $type eq 'w' ) { $bond_str = NO_BREAK if ( !$old_breakpoint_to_go[$i] - && substr( $next_nonblank_token, 0, 1 ) eq '/' ); + && substr( $next_nonblank_token, 0, 1 ) eq '/' + && $next_nonblank_type ne '//' ); } $bond_str_2 = $bond_str if (DEBUG_BOND);