From: Steve Hancock Date: Wed, 13 Jan 2021 01:14:02 +0000 (-0800) Subject: Correct formula for estimating line length with -wn option X-Git-Tag: 20210402~89 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a50ecf85319fcb89cf862f995616fab784a54ae8;p=perltidy.git Correct formula for estimating line length with -wn option --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index ddf2d818..256ccd84 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -6698,8 +6698,10 @@ sub weld_nested_containers { $Kfirst <= 0 ? 0 : $rLL->[ $Kfirst - 1 ]->[_CUMULATIVE_LENGTH_]; $starting_indent = 0; if ( !$rOpts_variable_maximum_line_length ) { - my $level = $rLL->[$Kfirst]->[_LEVEL_]; - $starting_indent = $rOpts_indent_columns * $level; + my $level = $rLL->[$Kfirst]->[_LEVEL_]; + my $ci_level = $rLL->[$Kfirst]->[_CI_LEVEL_]; + $starting_indent = $rOpts_indent_columns * $level + + $ci_level * $rOpts_continuation_indentation; } # DO-NOT-WELD RULE 1: diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index 29de28bc..f653ce96 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,14 +2,20 @@ =over 4 -=item B +=item B + +A formula used to estimating maximum line length when the -wn option is set was +missing a term for continuation indentation. No actual changes in formatting +have been seen. This update made 12 Jan 2021. + +=item B The following blinker was found in random testing. The following statement (with @j starting at level 0) @j = ( $x, $y, $z ); -run with the following profile +run with the following parameters --indent-columns=5 --continuation-indentation=7