]> git.donarmstrong.com Git - perltidy.git/commitdiff
Fix formatting instability, b1193
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 13 Aug 2021 14:15:31 +0000 (07:15 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 13 Aug 2021 14:15:31 +0000 (07:15 -0700)
dev-bin/run_convergence_tests.pl.data
lib/Perl/Tidy/Formatter.pm
local-docs/BugLog.pod

index 46e7d51180c5b7e34da1f86549ad1ad0b8decbea..e97ee52923051a726af9027f8fa5dc412077033f 100644 (file)
@@ -7139,6 +7139,28 @@ print
 --line-up-parentheses
 --maximum-line-length=48
 
+==> b1193.in <==
+# S1
+                              $config->{$key}
+                               =[
+                                  $config->{
+                                        $key} ];
+# S2
+                              $config->{$key}
+                               =[
+                                  $config->{$key}
+                               ];
+
+==> b1193.par <==
+--noadd-whitespace
+--break-before-all-operators
+--continuation-indentation=1
+--delete-old-whitespace
+--indent-columns=6
+--line-up-parentheses
+--maximum-line-length=49
+--square-bracket-vertical-tightness-closing=1
+
 ==> b120.in <==
 # Same as bug96
 # State 1
index 82b11194d5a86d83e4efc07f428a751ab756d56d..64fd31e291dc8e21a9301a17571dd6033c3e336e 100644 (file)
@@ -15991,13 +15991,18 @@ sub set_continuation_breaks {
                 $length_tol_boost = 0;    # was 1 for FIX2, 0 for FIX3
             }
             else {
-                $length_tol_boost = 0;    # was 3 for FIX2, 0 for FIX3
+                foreach ( keys %closing_vertical_tightness ) {
+                    next
+                      unless ( $closing_vertical_tightness{$_} );
+                    $length_tol_boost = 1;    # Fixes B1193;
+                    last;
+                }
             }
         }
 
         # The -xci option alone also needs a slightly larger tol for non-lists
         elsif ( $rOpts->{'extended-continuation-indentation'} ) {
-            $length_tol_boost = 0;        # was 1 for FIX2, 0 for FIX3
+            $length_tol_boost = 0;    # was 1 for FIX2, 0 for FIX3
         }
         return;
     }
index 0f5abb5794765e5eecbd67a9259424a6cf9342a8..95113ace5870999b79030837d2645e6abbdb76d2 100644 (file)
@@ -2,6 +2,14 @@
 
 =over 4
 
+=item B<Fix formatting instability, b1193>
+
+Testing with random parameters produced unstable formatting
+involving parameters which included -lp -sbvtc=1. This update
+fixes this problem, case b1193.
+
+13 Aug 2021.
+
 =item B<Fix error in tokenizer, issue c055>
 
 The ultimate cause of the undefined variable reference in the previous issue was