]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix issue b1330, -xlp edge case
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 25 Mar 2022 02:14:02 +0000 (19:14 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 25 Mar 2022 02:14:02 +0000 (19:14 -0700)
dev-bin/run_convergence_tests.pl.data
lib/Perl/Tidy/Formatter.pm

index 1517ac34cb3cbad4219cb65b7f711d40d68b4851..d1c33ae058899bdf860cda9529a2399bbd503780 100644 (file)
@@ -9624,6 +9624,25 @@ WriteMakefile(
 --variable-maximum-line-length
 --want-break-before='='
 
+==> b1330.in <==
+  print $tbl->render_row(
+    [    #
+      "$STATUS->{$status}->[2] $STATUS->{$status}->[0] $RESET",
+      "$STATUS->{$status}->[2]  @{[ $total->{data}->{$status} // 0 ]}  $RESET",
+    ]
+  );
+
+  print $tbl->render_row(
+   [    #
+     "$STATUS->{$status}->[2] $STATUS->{$status}->[0] $RESET",
+     "$STATUS->{$status}->[2]  @{[ $total->{data}->{$status} // 0 ]}  $RESET", ]
+  );
+
+==> b1330.par <==
+--extended-line-up-parentheses
+--indent-columns=1
+--square-bracket-vertical-tightness-closing=1
+
 ==> b140.in <==
 $cmd[ $i ]=[
         $s, $e, $cmd, \@hunk, $i ] ;
index beb473970976c78da3e85ec9a0bc8f39e559a96f..09e3569026f18983f00b8c3ca94ea2ff08cb13e0 100644 (file)
@@ -10916,9 +10916,12 @@ sub collapsed_lengths {
                 defined($K_c)
                 && $rLL->[$K_terminal]->[_TYPE_] eq ','
 
-                # Ignore a terminal comma, causes instability (b1297)
-                && (   $K_c - $K_terminal > 2
-                    || $rLL->[ $K_terminal + 1 ]->[_TYPE_] eq 'b' )
+                # Ignore a terminal comma, causes instability (b1297, b1330)
+                && (
+                    $K_c - $K_terminal > 2
+                    || (   $K_c - $K_terminal == 2
+                        && $rLL->[ $K_terminal + 1 ]->[_TYPE_] ne 'b' )
+                )
               )
             {
                 my $Kend = $K_terminal;