From a72feb082b75fc8b5d9ca13be692991a00680858 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Mon, 13 Dec 2021 12:09:45 -0800 Subject: [PATCH] check for long here-doc lines for -xlp --- lib/Perl/Tidy/Formatter.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index f1428fe5..1c0758ba 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -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 } -- 2.39.5