From: Steve Hancock Date: Sat, 9 Apr 2022 14:23:08 +0000 (-0700) Subject: fix instability when -ci>-i and -bbxi=2; issue b1334 X-Git-Tag: 20220217.03~8 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a1c0ad5e96cc9edf719a7b3f6a4e3a0cf0f5c28e;p=perltidy.git fix instability when -ci>-i and -bbxi=2; issue b1334 --- diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index 70f0d039..01d978e8 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -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 ] ; diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 3873332e..db403dd3 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -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);