From 1def82ff72d6f0fe28bc95bf83042ab469d4f91b Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Fri, 11 Sep 2020 16:31:46 -0700 Subject: [PATCH] fixed rare bug involving incorrect cache writing order --- lib/Perl/Tidy/VerticalAligner.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index 5160ac37..17171fd9 100644 --- a/lib/Perl/Tidy/VerticalAligner.pm +++ b/lib/Perl/Tidy/VerticalAligner.pm @@ -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; } -- 2.39.5