From: Steve Hancock Date: Tue, 12 May 2020 14:14:16 +0000 (-0700) Subject: fix problem causing failure of test case sub3.def X-Git-Tag: 20200619~32 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c9ef9cf242bdded64f6c765e2cc34c6171f651e8;p=perltidy.git fix problem causing failure of test case sub3.def --- 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; }