]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix b1356
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 30 Jun 2022 13:11:21 +0000 (06:11 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 30 Jun 2022 13:11:21 +0000 (06:11 -0700)
dev-bin/run_convergence_tests.pl.data
lib/Perl/Tidy/Formatter.pm

index 6be37e2f3fd55298004deccfde018825af10ee56..188498764e6fb19e3217e8ef0130ae015e1ba7f0 100644 (file)
@@ -10067,6 +10067,30 @@ my $data =
 --indent-columns=1
 --maximum-line-length=72
 
+==> b1356.in <==
+# S1
+%phonebook = (
+ "Bob"  => "247305",
+ "Phil" => "205832",
+ "Sara" => "226010"
+);
+
+# S2
+%phonebook
+         = (
+   "Bob"  => "247305",
+   "Phil" => "205832",
+   "Sara" => "226010"
+         );
+
+
+==> b1356.par <==
+--continuation-indentation=9
+--extended-line-up-parentheses
+--indent-columns=1
+--maximum-line-length=22
+--want-break-before=' = '
+
 ==> b140.in <==
 $cmd[ $i ]=[
         $s, $e, $cmd, \@hunk, $i ] ;
index 742f751c52fe0ef38e9f8ee25d0a103881dd4bc5..57f7b048f4dc422c415e5797df6a22b931626a03 100644 (file)
@@ -21558,8 +21558,13 @@ sub get_available_spaces_to_go {
                     my $i_test = $last_equals;
 
                     # Fix for issue b1229, check for break before
+                    # Fix for issue b1356, i_test must never be blank
+                    #   ( the ci value for blanks can vary )
                     if ( $want_break_before{ $types_to_go[$i_test] } ) {
-                        if ( $i_test > 0 ) { $i_test-- }
+                        if ( $i_test > 0 && $types_to_go[ $i_test - 1 ] ne 'b' )
+                        {
+                            $i_test--;
+                        }
                     }
                     elsif ( $types_to_go[ $i_test + 1 ] eq 'b' ) { $i_test++ }