From: Steve Hancock Date: Sat, 7 Aug 2021 00:37:29 +0000 (-0700) Subject: add comment about starting nesting depth X-Git-Tag: 20210717.02~61 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=e688e4b41016688d215066c9dd410c4a0a2da30e;p=perltidy.git add comment about starting nesting depth --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 1ab078bf..5b78ed00 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -4682,9 +4682,13 @@ EOM $rtype_sequence, $input_line_no ); # Find the starting nesting depth ... - # it is the value of variable 'slevel' of the first token. + # It must be the value of variable 'level' of the first token + # because the nesting depth is used as a token tag in the + # vertical aligner and is compared to actual levels. + # So vertical alignment problems will occur with any other + # starting value. if ( !defined($nesting_depth) ) { - $nesting_depth = $rslevels->[0]; + $nesting_depth = $rlevels->[0]; $nesting_depth = 0 if ( $nesting_depth < 0 ); $rdepth_of_opening_seqno->[SEQ_ROOT] = $nesting_depth - 1; }