## 2021 01 xx
+ - Fixed issue git #51, a closing qw bare paren was not being outdented when
+ the -nodelete-old-newlines flag was set.
+
- Fixed a rare problem with -lp formatting which could cause alternating
output states. Except for some very deeply nested data structures,
most scripts formatted with this option will not be changed.
$type_end_next = $rLL->[$Kend_next]->[_TYPE_];
$ljump = $rLL->[$Kbeg_next]->[_LEVEL_] - $rLL->[$Kend]->[_LEVEL_];
}
+ else {
+
+ # Patch for git #51, a bare closing qw paren was not outdented
+ # if the flag '-nodelete-old-newlines is set
+ my $Kbeg_next = $self->K_next_code($Kend);
+ if ( defined($Kbeg_next) ) {
+ $ljump = $rLL->[$Kbeg_next]->[_LEVEL_] - $rLL->[$Kend]->[_LEVEL_];
+ }
+ }
# level jump at end of line for the vertical aligner:
my $level_jump =
|| ( $i_terminal > $ibeg
&& $is_closing_type{ $types_to_go[$iend] } )
+ # Alternate Patch for git #51, isolated closing qw token not
+ # outdented if no-delete-old-newlines is set. This works, but
+ # a more general patch elsewhere fixes the real problem: ljump.
+ # || ( $seqno_qw_closing && $ibeg == $i_terminal )
+
)
{
$adjust_indentation = 1;
=over 4
+=item B<Fix for issue git #51, closing qw paren not outdented when -ndnl is set>
+
+The problem is that a bare closing qw paren was not being outdented
+if the flag '-nodelete-old-newlines is set. For example
+
+ # OLD (OK, outdented): perltidy -ci=4 -xci
+ {
+ modules => [
+ qw(
+ JSON
+ )
+ ],
+ }
+
+
+ # OLD (indented) : perltidy -ndnl -ci=4 -xci
+ {
+ modules => [
+ qw(
+ JSON
+ )
+ ],
+ }
+
+ # FIXED: perltidy -ndnl -ci=4 -xci
+ {
+ modules => [
+ qw(
+ JSON
+ )
+ ],
+ }
+
+The problem happened because the -ndnl flag forces each line to be written
+immediately, so the next line (which needs to be checked in this case) was not
+available when the outdent decision had to be made. A patch to work around
+this was added 24 Jan 2021.
+
=item B<Some issues with the -lp option>
Random testing revealed some problems involving the B<-lp> option which are