]> git.donarmstrong.com Git - perltidy.git/commitdiff
Do not break one-line block at here target
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 11 Feb 2021 14:50:42 +0000 (06:50 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 11 Feb 2021 14:50:42 +0000 (06:50 -0800)
lib/Perl/Tidy/Formatter.pm
local-docs/BugLog.pod

index 292f9603cd878a23c9b9f1fcf344cd318c7dae26..50ba34b237fcf5e0a0def42bf0f14006a99407db 100644 (file)
@@ -9906,7 +9906,7 @@ EOM
 
                 # no newlines after seeing here-target
                 $no_internal_newlines = 2;
-                destroy_one_line_block();
+                ## destroy_one_line_block();  # deleted to fix case b529
                 $self->store_token_to_go( $Ktoken_vars, $rtoken_vars );
             }
 
index abeeebc5d0777ca8f54a7ec68ad8930fffef69aa..619c049f83de40817fbdc8e68a78bef775d5a7d0 100644 (file)
@@ -2,6 +2,24 @@
 
 =over 4
 
+=item B<Do not break one-line block at here target>
+
+A blinking state produced by random testing was traced to a line of coding
+which which unnecessarily prevented one-line blocks from being formed when a
+here-target was encountered.  This has been fixed.
+
+For example, the code block in the following contains a here target and was being
+broken into two lines:
+
+    unless ($INC{$file}) {
+        die <<"END_DIE" }
+
+These will now be output with the blocks intact, like this
+
+    unless ($INC{$file}) { die <<"END_DIE" }
+
+This fixes case b523. 11 Feb 2021.
+
 =item B<Skip processing -kgb* flags in lists or if -maximum-consecutive-blank-lines=0>
 
 Random testing produced an alternating state which was caused by -kgb flags
@@ -10,7 +28,7 @@ was added to prevent this.  Also, the -kgb* flags have no effect if no blank
 lines can be output, so a check was added for this situation.  This fixes case
 b760.
 
-10 Feb 2021.
+10 Feb 2021, 177fc3a.
 
 =item B<Modify tolerance in testing for welds>