## 2021 07 17.02
+ - Update the man pages to clarify the flags -valign and -novalign
+ for turning vertical alignment on and off (issue git #72).
+ Added parameters -vc -vsc -vbc for separately turning off vertical
+ alignment of code, side comments and block comments.
+
- Fixed problem where a blank line following a closing code-skipping
comment, '#>>V', can be lost. A workaround for the previous version
is to include the parameter '-mbl=2'.
( $lbs, $rbs );
}
}
+ return;
};
my $break_before = sub {
( $lbs, $rbs );
}
}
+ return;
};
$break_after->(@all_operators) if ( $rOpts->{'break-after-all-operators'} );
$closing_container_inside_ws{$sequence_number} = $ws_flag;
}
}
+ return;
};
my ( $ws_1, $ws_2, $ws_3, $ws_4 );
# and finally, add this item to the new array
push @{$rLL_new}, $item;
+ return;
};
my $store_token_and_space = sub {
# then the token
$store_token->($item);
+ return;
};
my $add_phantom_semicolon = sub {
$store_token->($rcopy);
push @{$rK_phantom_semicolons}, @{$rLL_new} - 1;
}
+ return;
};
my $check_Q = sub {
"Line $lno: Note: be sure you want '$previous_nonblank_token' instead of '$guess' here\n"
);
}
+ return;
};
############################################
}
}
}
+ return;
};
my $delete_if_blank = sub {
while ( my $ibl = pop(@iblanks) ) { $rhash_of_desires->{$ibl} = 2 }
+ return;
};
my $end_group = sub {
@group = ();
@subgroup = ();
@iblanks = ();
+
+ return;
};
my $find_container_end = sub {
&& $token =~ /$closing_side_comment_prefix_pattern/ )
);
- # - For the particular combination -vc -nvsc, we put all side comments
+ # - For the specific combination -vc -nvsc, we put all side comments
# at fixed locations. Note that we will lose hanging side comment
# alignments. Otherwise, hsc's can move to strange locations.
- # - For -nvc -nvsc we will make all side comments vertical alignments
+ # - For -nvc -nvsc we make all side comments vertical alignments
# because the vertical aligner will check for -nvsc and be able
# to reduce the final padding to the side comments for long lines.
# and keep hanging side comments aligned.
sub make_alignment_patterns {
# Here we do some important preliminary work for the
- # vertical aligner. We create three arrays for one
+ # vertical aligner. We create four arrays for one
# output line. These arrays contain strings that can
# be tested by the vertical aligner to see if
# consecutive lines can be aligned vertically.
#
- # The three arrays are indexed on the vertical
+ # The four arrays are indexed on the vertical
# alignment fields and are:
# @tokens - a list of any vertical alignment tokens for this line.
# These are tokens, such as '=' '&&' '#' etc which
# @patterns - a modified list of token types, one for each alignment
# field. These should normally each match before alignment is
# allowed, even when the alignment tokens match.
+ # @field_lengths - the display width of each field
+
my ( $self, $ibeg, $iend, $ralignment_type_to_go ) = @_;
my @tokens = ();
my @fields = ();
# Place one line in the current vertical group.
#
- # The input parameters are:
- # $level = indentation level of this line
- # $rfields = reference to array of fields
- # $rpatterns = reference to array of patterns, one per field
- # $rtokens = reference to array of tokens starting fields 1,2,..
+ # The key input parameters describing each line are:
+ # $level = indentation level of this line
+ # $rfields = ref to array of fields
+ # $rpatterns = ref to array of patterns, one per field
+ # $rtokens = ref to array of tokens starting fields 1,2,..
+ # $rfield_lengths = ref to array of field display widths
#
# Here is an example of what this package does. In this example,
# we are trying to line up both the '=>' and the '#'.
# spot to take special action on failure to move
}
}
+ return;
};
foreach my $task ( @{$rtodo} ) {
my $length_match = $rfield_lengths_match->[$i];
if ( $length ne $length_match ) { $rneed_pad->[$i] = 1 }
}
+ return;
};
my $end_match = sub {
delete_selected_tokens( $rnew_lines->[$j], \@idel );
}
}
+ return;
};
foreach my $item ( @{$rsubgroups} ) {