From: Steve Hancock Date: Thu, 21 Apr 2022 03:37:22 +0000 (-0700) Subject: work around conflict of -vmll -xci -bbxi=2 (b1336) X-Git-Tag: 20220613~53 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=20d2a998e66620576b4bd34be43d6218afbd598b;p=perltidy.git work around conflict of -vmll -xci -bbxi=2 (b1336) --- diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index 260f108f..81bb70cc 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -9729,6 +9729,30 @@ params => --indent-columns=0 --maximum-line-length=96 +==> b1336.in <== +# S1 + my $expect = + [ + { + type => 'preformatted', + text => "preformatted line\n", + } + ]; + +# S2 + my $expect = + [ + { type => 'preformatted', text => "preformatted line\n", } ]; + +==> b1336.par <== +--break-before-square-bracket-and-indent=2 +--break-before-square-bracket=2 +--continuation-indentation=8 +--extended-continuation-indentation +--ignore-old-breakpoints +--maximum-line-length=63 +--variable-maximum-line-length + ==> b1337.in <== # S1: 'new' was given type 'i' here print JSON::PP->new diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 3b67d57a..b069f395 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -10188,7 +10188,13 @@ sub break_before_list_opening_containers { next; } - # -bbxi=2 ... + # -bbxi=2: This option changes the level ... + # This option can conflict with -xci in some cases. We can turn off + # -xci for this container to avoid blinking. For now, only do this if + # -vmll is set. ( fixes b1335, b1336 ) + if ($rOpts_variable_maximum_line_length) { + $rno_xci_by_seqno->{$seqno} = 1; + } #---------------------------------------------------------------- # Part 2: Perform tests before committing to changing ci and level