]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix issue b1212, unusual weld instability
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 4 Oct 2021 02:07:53 +0000 (19:07 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 4 Oct 2021 02:07:53 +0000 (19:07 -0700)
dev-bin/run_convergence_tests.pl.data
lib/Perl/Tidy/Formatter.pm

index 4ef250244985c1aa3b0c3e6fa9ba9cca65f49f83..9ce2592d3e53da6d8d4d96d00c77a703cfd8f63d 100644 (file)
@@ -7456,6 +7456,30 @@ $bc[
 --maximum-line-length=34
 --variable-maximum-line-length
 
+==> b1212.in <==
+# S1
+  my $line_count
+      = scalar
+      @{ [lines ()]
+      };
+
+# S2
+  my $line_count
+      = scalar @{ [
+    lines ()
+      ] };
+
+==> b1212.par <==
+--break-before-all-operators
+--continuation-indentation=4
+--ignore-old-breakpoints
+--indent-columns=2
+--maximum-line-length=17
+--space-function-paren
+--square-bracket-tightness=2
+--variable-maximum-line-length
+--weld-nested-containers
+
 ==> b1218.in <==
 # S1
 is(
index 170a60bdb0d706ea27906ca07a1468ca062042a6..79b08273f34d9b4b0a8ad8226f446cfef340b058 100644 (file)
@@ -8206,9 +8206,10 @@ sub weld_nested_containers {
     my $iline_outer_opening   = -1;
     my $weld_count_this_start = 0;
 
-    # $single_line_tol added to fix cases b1180 b1181
-    my $single_line_tol =
-      $rOpts_continuation_indentation > $rOpts_indent_columns ? 1 : 0;
+    # OLD: $single_line_tol added to fix cases b1180 b1181
+    #       = $rOpts_continuation_indentation > $rOpts_indent_columns ? 1 : 0;
+    # NEW: $single_line_tol=0;  fixes b1212 and b1180-1181 work now
+    my $single_line_tol = 0;
 
     my $multiline_tol = $single_line_tol + 1 +
       max( $rOpts_indent_columns, $rOpts_continuation_indentation );