]> git.donarmstrong.com Git - perltidy.git/commitdiff
Correct formula for estimating line length with -wn option
authorSteve Hancock <perltidy@users.sourceforge.net>
Wed, 13 Jan 2021 01:14:02 +0000 (17:14 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Wed, 13 Jan 2021 01:14:02 +0000 (17:14 -0800)
lib/Perl/Tidy/Formatter.pm
local-docs/BugLog.pod

index ddf2d8181cc579fa07efcf77ac476b4355498a97..256ccd84183926a9fe4103ba812427e350aa72c1 100644 (file)
@@ -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:
index 29de28bc4c264f603aa6f12ebcc4d5fef1b26ebd..f653ce967b0f9b107a8e6501b2e39d5e72f3e739 100644 (file)
@@ -2,14 +2,20 @@
 
 =over 4
 
-=item B<Fixed unusual blinker>
+=item B<Correct formula for estimating line length with -wn option>
+
+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<Fixed unusual blinker related to large -ci and -mft=n>
 
 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