]> git.donarmstrong.com Git - perltidy.git/commitdiff
check for long here-doc lines for -xlp
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 13 Dec 2021 20:09:45 +0000 (12:09 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 13 Dec 2021 20:09:45 +0000 (12:09 -0800)
lib/Perl/Tidy/Formatter.pm

index f1428fe5b36d00b3ddae5393bb30648d5c7aec04..1c0758ba065d356e944ecb280e7378ba04b88e04 100644 (file)
@@ -10447,6 +10447,14 @@ sub collapsed_lengths {
                 # only one => per item
                 if ( $last_nonblank_type eq '=>' ) { $len = $token_length }
             }
+            elsif ( $type eq 'h' ) {
+                my $iline    = $rLL->[$KK]->[_LINE_INDEX_];
+                my $rK_range = $rlines->[$iline]->{_rK_range};
+                my ( $K_first, $K_last ) = @{$rK_range};
+                $len = $rLL->[$K_last]->[_CUMULATIVE_LENGTH_] -
+                  $rLL->[ $KK - 1 ]->[_CUMULATIVE_LENGTH_];
+                if ( $len > $max_prong_len ) { $max_prong_len = $len }
+            }
             else {
                 $len = $token_length;
                 if ( $len > $max_prong_len ) { $max_prong_len = $len }