fixed rare bug involving incorrect cache writing order
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 11 Sep 2020 23:31:46 +0000 (16:31 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 11 Sep 2020 23:31:46 +0000 (16:31 -0700)
lib/Perl/Tidy/VerticalAligner.pm

index 5160ac370cfe381f851da496bdc0061c9c51d8cd..17171fd96c047300a1d5ae668b0616d591465995 100644 (file)
@@ -186,15 +186,17 @@ sub flush {
     # flush() is the external call to completely empty the pipeline.
     my ($self) = @_;
 
-    # the buffer must be emptied first
-    $self->dump_valign_buffer();
+    # push things out the pipline...
 
-    # then any current group
+    # push out any current group lines
     $self->_flush_group_lines();
 
-    # then the cache, which may still contain text if there was
-    # no group
+    # then anything left in the cache of step_B
     $self->_flush_cache();
+
+    # then anything left in the buffer of step_C
+    $self->dump_valign_buffer();
+
     return;
 }