From 55aa969336da8018fc0b774f6d9b59f0b5c60872 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Thu, 21 Jul 2022 23:04:53 -0700 Subject: [PATCH] improve some line breaks --- lib/Perl/Tidy/Formatter.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- 2.39.5