# (1) the containers are all on one line, and
# (2) the line does not exceed the allowable length, and
# This flag is used to avoid creating blinkers.
- # Changed 'excess_length_to_K' to 'excess_length_of_line'
+ # FIX1: Changed 'excess_length_to_K' to 'excess_length_of_line'
# to get exact lengths and fix b604 b605.
- if ( $iline_oo == $iline_oc
- && $excess_length_of_line->( $Kfirst, $Klast ) <= 0 )
- {
- $is_one_line_weld = 1;
+ if ( $iline_oo == $iline_oc ) {
+ my $excess = $excess_length_of_line->( $Kfirst, $Klast );
+ if ( $excess <= 0 ) {
+
+ # FIX2: Patch for b1114: add a tolerance of one level if
+ # this line has an unbalanced start. This helps prevent
+ # blinkers in unusual cases for lines near the length limit
+ # by making it more likely that RULE 2 will prevent a weld.
+ my $level_diff =
+ $outer_opening->[_LEVEL_] - $rLL->[$Kfirst]->[_LEVEL_];
+
+ if ( !$level_diff || $excess + $rOpts_indent_columns <= 0 ) {
+ $is_one_line_weld = 1;
+ }
+ }
}
# DO-NOT-WELD RULE 1:
=over 4
+=item B<Fix rare problem with -lp -wn>
+
+Random testing produced case b1114 which gave unstable formatting with these
+parameters
+
+ --noadd-whitespace
+ --indent-columns=8
+ --line-up-parentheses
+ --maximum-line-length=25
+ --weld-nested-containers
+
+and this snippet
+
+ is(length(pack("j", 0)),
+ $Config{ivsize});
+
+Fixed 19 Apr 2021.
+
=item B<Fix issue git#63>
The following lines produced an error message due to the side comment
my $fragment = $parser-> #parse_html_string
parse_balanced_chunk($I);
-This has been fixed.
-18 Apr 2021.
+Fixed 18 Apr 2021.
=item B<Avoid welding at sort/map/grep paren calls>