]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix b1469
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 9 May 2024 14:08:26 +0000 (07:08 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 9 May 2024 14:08:26 +0000 (07:08 -0700)
dev-bin/run_convergence_tests.pl.data
dev-bin/run_convergence_tests.pl.expect
lib/Perl/Tidy/Formatter.pm

index 04663be9b421710a6e80c638d989cf4f25ad9514..f795902f3266a56164bb824d505f3fcd5f0471b4 100644 (file)
@@ -12075,6 +12075,32 @@ foreach $n (
 --block-brace-vertical-tightness=1
 --nodelete-old-newlines
 
+==> b1469.in <==
+my @outer =
+        (
+         [
+          'a1', 'a2', 'a3',
+         ], [
+          'b1', 'b2', 'b3',
+         ], [
+          'c1', 'c2', 'c3',
+         ],
+        );
+
+my @outer = (
+ [ 'a1', 'a2', 'a3', ],
+ [ 'b1', 'b2', 'b3', ],
+ [ 'c1', 'c2', 'c3', ],
+);
+
+==> b1469.par <==
+--maximum-line-length=35
+--indent-columns=1
+--continuation-indentation=8
+--extended-continuation-indentation
+--break-before-paren=2
+--opening-square-bracket-right
+
 ==> b148.in <==
 # state 1
 @yydgoto=(
index cbad2352d0d2826b2068541bfdc8fb82efa6e8bd..2b3ab805566518fab2330d50248436c72fdbda2e 100644 (file)
@@ -8188,6 +8188,29 @@ foreach $n (
      }
 }
 
+==> b1469 <==
+my @outer =
+        (
+         [
+          'a1', 'a2', 'a3',
+         ], [
+          'b1', 'b2', 'b3',
+         ], [
+          'c1', 'c2', 'c3',
+         ],
+        );
+
+my @outer =
+        (
+         [
+          'a1', 'a2', 'a3',
+         ], [
+          'b1', 'b2', 'b3',
+         ], [
+          'c1', 'c2', 'c3',
+         ],
+        );
+
 ==> b148 <==
 # state 1
 @yydgoto=(
index b27a27685b232b4ea2ff3fcca64b4a9a704a3aba..d636ca5032c94122a3220dbfbee4b3007e79e0b2 100644 (file)
@@ -17480,10 +17480,18 @@ sub break_before_list_opening_containers {
         # decide if a list is complex.  For now it is only applied when -lp
         # and -vmll are used, but eventually it may become the standard method.
         # Fixes b1274, b1275, and others, including b1099.
+        # Update: case b1469 also had this type of problem; it had the
+        # combination ci>i and used -xci. This is just a band-aid; eventually
+        # it might be best if all cases use this logic, but that would change
+        # existing formatting.
         if ( $break_option == 2 ) {
 
+            my $b1469 = $rOpts_continuation_indentation > $rOpts_indent_columns
+              && $rOpts_extended_continuation_indentation;
+
             if (   $rOpts_line_up_parentheses
-                || $rOpts_variable_maximum_line_length )
+                || $rOpts_variable_maximum_line_length
+                || $b1469 )
             {
 
                 # Start with the basic definition of a complex list...