## 2021 07 17.02
+ - Fix issue git #73, the -nfpva flag was not working correctly.
+ Some unwanted vertical alignments of spaced function perens
+ were being made.
+
- 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
t/snippets22.t
t/snippets23.t
t/snippets24.t
+t/snippets25.t
t/snippets3.t
t/snippets4.t
t/snippets5.t
==> b1207.par <==
--nowant-right-space='x'
+==> b1208.in <==
+# S1
+
+ my $home = (
+ $^O =~ /mswin32/i
+ ? $ENV{HOME}
+ : (
+ eval { ( getpwuid($>) )[7]; } ## end eval
+ || $ENV{HOME}
+ )
+ );
+
+# S2
+
+ my $home = (
+ $^O =~ /mswin32/i
+ ? $ENV{HOME}
+ : (
+ eval {
+ ( getpwuid($>) )[7];
+ } ## end eval
+ || $ENV{HOME}
+ )
+ );
+
+==> b1208.par <==
+--continuation-indentation=9
+--extended-continuation-indentation
+--maximum-line-length=54
+
==> b131.in <==
unless
( open( SCORE, "+>>$Score_File" ) )
-#####################################################################
+####################################################################
#
# The Perl::Tidy::Formatter package adds indentation, whitespace, and
# line breaks to the token stream
# Get next nonblank on this line
my $next_nonblank_token = '';
my $next_nonblank_token_type = 'b';
+ my $Knnb;
if ( $Ktoken_vars < $K_last ) {
- my $Knnb = $Ktoken_vars + 1;
+ $Knnb = $Ktoken_vars + 1;
if ( $rLL->[$Knnb]->[_TYPE_] eq 'b'
&& $Knnb < $K_last )
{
# If there is a pending one-line block ..
if ( $index_start_one_line_block != UNDEFINED_INDEX ) {
+ # Fix for b1208: if a side comment follows this closing
+ # brace then we must include its length in the length test.
+ # Assume a minimum of 1 blank space to the comment.
+ my $added_length =
+ $side_comment_follows
+ ? 1 + $rLL->[$Knnb]->[_TOKEN_LENGTH_]
+ : 0;
+
# we have to terminate it if..
if (
# initial estimate). note: must allow 1 space for this
# token
$self->excess_line_length( $index_start_one_line_block,
- $max_index_to_go ) >= 0
+ $max_index_to_go ) + $added_length >= 0
# or if it has too many semicolons
|| ( $semicolons_before_block_self_destruct == 0
=over 4
+=item B<Fix issue b1208>
+
+Test with random parameters produced a formatting instability which could be
+triggered when there is a short line length limit and there is a long side
+comment on the closing brace of a sort/map/grep/eval block. The problem was
+due to not correctly including the length of the side comment when testing to
+see if the block could fit on one line. This update fixes issue b1208.
+
+18 Sep 2021.
+
+=item B<Fix issue git #73>
+
+The -nfpva parameter was not working correctly for functions called with
+pointers. For example
+
+ # OLD: perltidy -sfp -nfpva
+ $self->method ( 'parameter_0', 'parameter_1' );
+ $self->method_with_long_name ( 'parameter_0', 'parameter_1' );
+
+ # FIXED: perltidy -sfp -nfpva
+ $self->method ( 'parameter_0', 'parameter_1' );
+ $self->method_with_long_name ( 'parameter_0', 'parameter_1' );
+
+The problem had to do with how the pointer tokens '->' are represented internally
+and has been fixed.
+
+17 Sep 2021.
+
=item B<Fix unusual parsing error b1207>
Testing with random parameters produced another instability caused by misparsing
This update fixes case b1207.
-15 Sep 2021.
+15 Sep 2021, 107586f.
=item B<Fix formatting instability b1206>