# looking for indentation item for which we are aligning
# with parens, braces, and brackets
- next unless ( $indentation->get_align_paren() );
+ next unless ( $indentation->get_align_seqno() );
# skip closed container on this line
if ( $i > $ibeg ) {
# reduced as necessary when long lines are encountered or when
# it becomes clear that we do not have a good list.
my $available_spaces = 0;
- my $align_paren = 0;
+ my $align_seqno = 0;
my $excess = 0;
my $last_nonblank_seqno;
$space_count = $min_gnu_indentation;
$available_spaces = 0;
}
- $align_paren = 1;
+ $align_seqno = $last_nonblank_seqno;
}
}
ci_level => $ci_level,
available_spaces => $available_spaces,
lp_item_index => $lp_item_index,
- align_paren => $align_paren,
+ align_seqno => $align_seqno,
stack_depth => $max_lp_stack,
K_begin_line => $K_begin_line,
);
_available_spaces_ => $i++,
_closed_ => $i++,
_comma_count_ => $i++,
- _sequence_number_ => $i++,
_lp_item_index_ => $i++,
_have_child_ => $i++,
_recoverable_spaces_ => $i++,
- _align_paren_ => $i++,
+ _align_seqno_ => $i++,
_marked_ => $i++,
_stack_depth_ => $i++,
_K_begin_line_ => $i++,
# recoverable_spaces => # how many spaces to the right
# # we would like to move to get
# # alignment (negative if left)
- # align_paren => # do we want to try to align
- # # with an opening structure?
+ # align_seqno => # if we are aligning with an opening structure,
+ # # this is its seqno
# marked => # if visited by corrector logic
# stack_depth => # indentation nesting depth
# K_begin_line => # first token index K of this level
$self->[_lp_item_index_] = $input_hash{lp_item_index};
$self->[_have_child_] = 0;
$self->[_recoverable_spaces_] = 0;
- $self->[_align_paren_] = $input_hash{align_paren};
+ $self->[_align_seqno_] = $input_hash{align_seqno};
$self->[_marked_] = 0;
$self->[_stack_depth_] = $input_hash{stack_depth};
$self->[_K_begin_line_] = $input_hash{K_begin_line};
return $self->[_available_spaces_];
}
-sub get_align_paren {
- return $_[0]->[_align_paren_];
+sub get_align_seqno {
+ return $_[0]->[_align_seqno_];
}
sub get_recoverable_spaces {
-# the closing braces should have the same position for these two hashes with -gnu
+ # These closing braces no longer have the same position with -gnu after an
+ # update 13 dec 2021 in which the vertical aligner zeros recoverable spaces.
+ # But adding the -xlp should make them all have the same indentation.
+ $var1 = {
+ 'foo10' => undef,
+ 'foo72' => ' ',
+ };
$var1 = {
'foo10' => undef,
'foo72' => '
',
'foo10' => undef,
};
-
- # the closing braces should have the same position for these two hashes with -gnu
+ # These closing braces no longer have the same position with -gnu after an
+ # update 13 dec 2021 in which the vertical aligner zeros recoverable spaces.
+ # But adding the -xlp should make them all have the same indentation.
+ $var1 = {
+ 'foo10' => undef,
+ 'foo72' => ' ',
+ };
$var1 = {
'foo10' => undef,
'foo72' => '
',
- };
+ };
$var2 = {
'foo72' => '
',
'foo10' => undef,
};
-
-# the closing braces should have the same position for these two hashes with -gnu
+# These closing braces no longer have the same position with -gnu after an
+# update 13 dec 2021 in which the vertical aligner zeros recoverable spaces.
+# But adding the -xlp should make them all have the same indentation.
+ $var1 = {
+ 'foo10' => undef,
+ 'foo72' => ' ',
+ };
$var1 = {
'foo10' => undef,
'foo72' => '
',
'foo10' => undef,
};
-
----------
'gnu6' => <<'----------',
-# the closing braces should have the same position for these two hashes with -gnu
+# These closing braces no longer have the same position with -gnu after an
+# update 13 dec 2021 in which the vertical aligner zeros recoverable spaces.
+# But adding the -xlp should make them all have the same indentation.
+ $var1 = {
+ 'foo10' => undef,
+ 'foo72' => ' ',
+ };
$var1 = {
'foo10' => undef,
'foo72' => '
',
'foo10' => undef,
};
-
----------
'hanging_side_comments3' => <<'----------',
source => "gnu6",
params => "def",
expect => <<'#9...........',
-# the closing braces should have the same position for these two hashes with -gnu
+ # These closing braces no longer have the same position with -gnu after an
+ # update 13 dec 2021 in which the vertical aligner zeros recoverable spaces.
+ # But adding the -xlp should make them all have the same indentation.
+ $var1 = {
+ 'foo10' => undef,
+ 'foo72' => ' ',
+ };
$var1 = {
'foo10' => undef,
'foo72' => '
',
'foo10' => undef,
};
-
#9...........
},
source => "gnu6",
params => "gnu",
expect => <<'#10...........',
- # the closing braces should have the same position for these two hashes with -gnu
+ # These closing braces no longer have the same position with -gnu after an
+ # update 13 dec 2021 in which the vertical aligner zeros recoverable spaces.
+ # But adding the -xlp should make them all have the same indentation.
+ $var1 = {
+ 'foo10' => undef,
+ 'foo72' => ' ',
+ };
$var1 = {
'foo10' => undef,
'foo72' => '
',
- };
+ };
$var2 = {
'foo72' => '
',
'foo10' => undef,
};
-
#10...........
},