From a50ecf85319fcb89cf862f995616fab784a54ae8 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Tue, 12 Jan 2021 17:14:02 -0800 Subject: [PATCH] Correct formula for estimating line length with -wn option --- lib/Perl/Tidy/Formatter.pm | 6 ++++-- local-docs/BugLog.pod | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) 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 -- 2.39.5