From e688e4b41016688d215066c9dd410c4a0a2da30e Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Fri, 6 Aug 2021 17:37:29 -0700 Subject: [PATCH] add comment about starting nesting depth --- lib/Perl/Tidy/Formatter.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; } -- 2.39.5