]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix issue b1378
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 3 Oct 2022 19:06:10 +0000 (12:06 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 3 Oct 2022 19:06:10 +0000 (12:06 -0700)
dev-bin/run_convergence_tests.pl.data
lib/Perl/Tidy/FileWriter.pm
lib/Perl/Tidy/Formatter.pm
lib/Perl/Tidy/VerticalAligner.pm

index 29ceacdc328e1cb297c5506d1fe7897869c5fa71..70dd2b3452fd2b592998f2c69c482ef4eab3c2a9 100644 (file)
@@ -10180,6 +10180,18 @@ $font_size
 --space-keyword-paren
 --weld-nested-containers
 
+==> b1378.in <==
+                           if($biblio->{subtitle})
+                           {        &newsubtitle(
+                                             $biblionumber,
+                                             $biblio
+                                                ->{subtitle}
+                                             ,);
+                                    }
+
+==> b1378.par <==
+-extrude -vtc=2 -dtc=1
+
 ==> b140.in <==
 $cmd[ $i ]=[
         $s, $e, $cmd, \@hunk, $i ] ;
index 2fd1c32d8d7b66ad93deadaa15bf5160c39c06e9..e5778166c95638f9605a11ba9c7d359d0eaf7479 100644 (file)
@@ -300,9 +300,11 @@ $str
 This is probably due to a recent programming change and needs to be fixed.
 EOM
 
+                # Always die during development, this needs to be fixed
                 if (DEVEL_MODE) { Fault($msg) }
 
-                $self->warning($msg);
+                # Otherwise warn if string is not empty (added for b1378)
+                $self->warning($msg) if ( length($str) );
 
                 # Only issue this warning once
                 $self->[_K_sequence_error_msg_] = $msg;
index 3b25c6c2889ad0ec8027e89692c1d4fe350b0fe8..0eaf34326d484d35a2d72b2871a5cca24650b7e1 100644 (file)
@@ -16039,7 +16039,7 @@ EOM
                         $summed_lengths_to_go[ $_ + 1 ] -= $len;
                     }
 
-                    # Keep count tokens deleted by this sub because
+                    # Count tokens deleted by this sub because
                     # we have to turn off the simple convergence test
                     # if there are deletions.  This is because they are
                     # at the end of formatting and may cause a formatting
index b536a0db63bba7dfeedc58e330fd936e2de2f842..0859fdc03ed4fbad0919aa181e763c73cce0d15a 100644 (file)
@@ -5286,7 +5286,11 @@ sub get_output_line_number {
 
         # write or cache this line ...
         # fix for case b999: do not cache an outdented line
-        if ( !$open_or_close || $side_comment_length > 0 || $is_outdented_line )
+        # fix for b1378: do not cache an empty line
+        if (  !$open_or_close
+            || $side_comment_length > 0
+            || $is_outdented_line
+            || !$line_length )
         {
             $self->valign_output_step_C(
                 $seqno_string,