}
# loop to prepare each line for shipment
- my $in_comma_list;
my ( $Kbeg, $type_beg, $token_beg );
my ( $Kend, $type_end );
for my $n ( 0 .. $n_last_line ) {
$rfield_lengths->[-1] += 2;
}
- # List flag for old method: Works well; a few problems, esp with side
- # comments. This will eventually be replaced with the new method.
- my $is_forced_break = $forced_breakpoint || $in_comma_list;
-
# List flag for new method: Works well but needs more testing
my $list_seqno = $self->is_list_by_K($Kbeg);
$rvalign_hash->{level_end} = $level_end;
$rvalign_hash->{level_adj} = $level_adj;
$rvalign_hash->{indentation} = $indentation;
- $rvalign_hash->{is_forced_break} = $is_forced_break;
$rvalign_hash->{list_seqno} = $list_seqno;
$rvalign_hash->{outdent_long_lines} = $outdent_long_lines;
$rvalign_hash->{is_terminal_ternary} = $is_terminal_ternary;
my $vao = $self->[_vertical_aligner_object_];
$vao->valign_input($rvalign_hash);
- $in_comma_list = $type_end eq ',' && $forced_breakpoint;
-
$do_not_pad = 0;
# Set flag indicating if this line ends in an opening
use constant DEBUG_VALIGN => 0;
-# Flag for use during conversion to using new $list_seqno
-# to identify lists of items. The flag 'is_forced_break' will
-# be removed when conversion is complete.
-use constant TEST_OLD_LIST => 0;
-
sub valign_input {
# Place one line in the current vertical group.
my $level_end = $rline_hash->{level_end};
my $level_adj = $rline_hash->{level_adj};
my $indentation = $rline_hash->{indentation};
- my $is_forced_break = $rline_hash->{is_forced_break};
my $list_seqno = $rline_hash->{list_seqno};
my $outdent_long_lines = $rline_hash->{outdent_long_lines};
my $is_terminal_ternary = $rline_hash->{is_terminal_ternary};
DEBUG_VALIGN && do {
my $nlines = $self->group_line_count();
print STDOUT
-"Entering valign_input: lines=$nlines new #fields= $jmax, leading_count=$leading_space_count force=$is_forced_break, level_jump=$level_jump, level=$level, group_level=$group_level, level_jump=$level_jump\n";
+"Entering valign_input: lines=$nlines new #fields= $jmax, leading_count=$leading_space_count, level_jump=$level_jump, level=$level, group_level=$group_level, level_jump=$level_jump\n";
};
# Validate cached line if necessary: If we can produce a container
# Decide if this is a simple list of items.
# We use this to be less restrictive in deciding what to align.
# --------------------------------------------------------------------
- if ( !TEST_OLD_LIST ) {
- decide_if_list($new_line) if ($list_seqno);
- }
- else {
- decide_if_list($new_line) if ($is_forced_break);
- }
+ decide_if_list($new_line) if ($list_seqno);
# --------------------------------------------------------------------
# Append this line to the current group (or start new group)
if (
$jend == $jbeg
&& $jend_m == $jbeg_m
- && !( $list_type && TEST_OLD_LIST )
&& ( $ng == 1 || $istop_mm < 0 )
&& ( $ng == $ng_max || $istop < 0 )
&& !$line->get_j_terminal_match()
next unless ( $imax_min >= 0 );
next
unless ( $rtokens->[0] =~ /^=\d/
- || ( !TEST_OLD_LIST && $list_type ) );
+ || $list_type );
# In this case we will limit padding to a short distance. This
# is a compromise to keep some vertical alignment but prevent large
elsif ( $list_type && $list_type eq $list_type_m ) {
# do not align lists across a ci jump with new list method
- if ( !TEST_OLD_LIST && $ci_jump ) { $imax_min = -1 }
+ if ($ci_jump) { $imax_min = -1 }
my $i_nomatch = $imax_min + 1;
for ( my $i = 0 ; $i <= $imax_min ; $i++ ) {