work around conflict of -vmll -xci -bbxi=2 (b1336)
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 21 Apr 2022 03:37:22 +0000 (20:37 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 21 Apr 2022 03:37:22 +0000 (20:37 -0700)
dev-bin/run_convergence_tests.pl.data
lib/Perl/Tidy/Formatter.pm

index 260f108f6124b2badd3dcb771b0def93649d7b83..81bb70cc43481b79032d8bd6651410503c719504 100644 (file)
@@ -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
index 3b67d57acc89473f8f4ab0a01a51699dbd62c312..b069f3955472cbc916fd9fceba368e5d2ae4306a 100644 (file)
@@ -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