From c9ef9cf242bdded64f6c765e2cc34c6171f651e8 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Tue, 12 May 2020 07:14:16 -0700 Subject: [PATCH] fix problem causing failure of test case sub3.def --- lib/Perl/Tidy/Formatter.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index b41896cc..e0866875 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -7430,7 +7430,7 @@ sub copy_token_as_type { # Fix for rt #125506 Unexpected string formating # in which leading space of a terminal quote was removed $line =~ s/\s+$//; - $line =~ s/^\s+// unless ($in_continued_quote); + $line =~ s/^\s+// unless ( $line_of_tokens->{_starting_in_quote} ); my $Ktoken_vars = $K_first; @@ -8384,7 +8384,10 @@ sub starting_one_line_block { } # find the starting keyword for this block (such as 'if', 'else', ...) - if ( $block_type =~ /^[\{\}\;\:]$/ || $block_type =~ /^package/ ) { + if ( $max_index_to_go == 0 + || $block_type =~ /^[\{\}\;\:]$/ + || $block_type =~ /^package/ ) + { $i_start = $max_index_to_go; } -- 2.39.5