]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix issue b1301
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 3 Jan 2022 13:34:33 +0000 (05:34 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 3 Jan 2022 13:34:33 +0000 (05:34 -0800)
dev-bin/run_convergence_tests.pl.data
lib/Perl/Tidy/Formatter.pm

index 535ce4d3a55e005a0d16f3bb72513b58b582f279..9526caa0ab1de4e5c472127d3c09b19e7d9b7957 100644 (file)
@@ -8693,6 +8693,36 @@ my $file = $menubar->Menubutton(
 --indent-columns=8
 --maximum-line-length=65
 
+==> b1301.in <==
+subtest '->save' => sub {
+    plan tests => 1;
+    my $layout
+    =C4::Patroncards::Layout->new (layout_name => "new patron card",
+                                   layout_id   => '',                # The interface send an empty string
+                                   layout_xml  => 'some_xml'
+    );
+};
+
+subtest '->save' => sub {
+    plan tests => 1;
+    my $layout
+    =C4::Patroncards::Layout->new (
+                                  layout_name => "new patron card",
+                                  layout_id   => '',                 # The interface send an empty string
+                                  layout_xml  => 'some_xml'
+    );
+};
+
+==> b1301.par <==
+--break-before-all-operators
+--continuation-indentation=0
+--extended-line-up-parentheses
+--ignore-side-comment-lengths
+--maximum-line-length=70
+--nowant-right-space='- = .= **= *= + >= >>= ||= != <<= >= + ||= < /= //='
+--space-function-paren
+--vertical-tightness=1
+
 ==> b131.in <==
         unless
           ( open( SCORE, "+>>$Score_File" ) )
index 8c54ff8ae1ce0d433bdb9889f485fb3d94fc6e68..be64b967d489146b5d904726effe3f8f747a8169 100644 (file)
@@ -10676,8 +10676,17 @@ sub collapsed_lengths {
                         {
                             $Kend = $K_last;
                         }
+
+                        # Measure from the next blank if any (fixes b1301)
+                        my $Kbeg = $KK;
+                        if (   $rLL->[ $Kbeg + 1 ]->[_TYPE_] eq 'b'
+                            && $Kbeg < $Kend )
+                        {
+                            $Kbeg++;
+                        }
                         my $len = $rLL->[$Kend]->[_CUMULATIVE_LENGTH_] -
-                          $rLL->[$KK]->[_CUMULATIVE_LENGTH_];
+                          $rLL->[$Kbeg]->[_CUMULATIVE_LENGTH_];
+
                         if ( $len > $max_prong_len ) { $max_prong_len = $len }
                     }