From: Steve Hancock Date: Mon, 13 Dec 2021 20:09:45 +0000 (-0800) Subject: check for long here-doc lines for -xlp X-Git-Tag: 20211029.04~8 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a72feb082b75fc8b5d9ca13be692991a00680858;p=perltidy.git check for long here-doc lines for -xlp --- 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 }