]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix instability when -ci>-i and -bbxi=2; issue b1334
authorSteve Hancock <perltidy@users.sourceforge.net>
Sat, 9 Apr 2022 14:23:08 +0000 (07:23 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sat, 9 Apr 2022 14:23:08 +0000 (07:23 -0700)
dev-bin/run_convergence_tests.pl.data
lib/Perl/Tidy/Formatter.pm

index 70f0d0398c710be38bb0d420a67da8ed8f8d10ed..01d978e8bd8cc13c0d51f477149b043f6b3e289f 100644 (file)
@@ -9703,6 +9703,32 @@ WriteMakefile PREREQ_PM =>
 ==> b1333.par <==
 --break-before-all-operators
 
+==> b1334.in <==
+# S1
+my $pcc_tt = Params::CheckCompiler::validation_for(
+params =>
+       [
+{ type => Int },
+{ type => ArrayRef },
+{ type => InstanceOf ['DateTime'], optional => 1 },
+       ],
+);
+
+# S2
+my $pcc_tt = Params::CheckCompiler::validation_for(
+params =>
+[
+{ type => Int }, { type => ArrayRef }, { type => InstanceOf ['DateTime'], optional => 1 },
+],
+);
+
+==> b1334.par <==
+--break-before-square-bracket-and-indent=2
+--break-before-square-bracket=2
+--continuation-indentation=7
+--indent-columns=0
+--maximum-line-length=96
+
 ==> b140.in <==
 $cmd[ $i ]=[
         $s, $e, $cmd, \@hunk, $i ] ;
index 3873332ed09822c60785bab093939701f80c02d5..db403dd30669a8c12f13e9c49d370c505e65e8fc 100644 (file)
@@ -19905,6 +19905,11 @@ EOM
             && $container_indentation_options{$opening_token} == 2 )
         {
             $tol = $rOpts_indent_columns;
+
+            # use greater of -ci and -i (fix for case b1334)
+            if ( $tol < $rOpts_continuation_indentation ) {
+                $tol = $rOpts_continuation_indentation;
+            }
         }
 
         my $i_opening_minus = $self->find_token_starting_list($i_opening_paren);