From 21ef53b1b3baf24b774dc3fdff2246e2b6795d7b Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Thu, 15 Apr 2021 18:53:10 -0700 Subject: [PATCH] Fix problem involving -bbx=2 -xci -osbr and similar -otr flags --- lib/Perl/Tidy/Formatter.pm | 9 +++++++++ local-docs/BugLog.pod | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 01704ff6..6ef9eeca 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -5018,6 +5018,15 @@ sub respace_tokens { if ( $is_opening_token{$token} ) { $K_opening_container->{$type_sequence} = $KK_new; + + # Fix for case b1100: Count a line ending in ', [' as having + # a line-ending comma. Otherwise, these commas can be hidden + # with something like --opening-square-bracket-right + if ( $Ktoken_vars == $Klast_old_code + && $last_nonblank_type eq ',' ) + { + $rlec_count_by_seqno->{$type_sequence}++; + } } elsif ( $is_closing_token{$token} ) { diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index 3d8cb8af..4ff950af 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -1,8 +1,16 @@ - =head1 Issues fixed after release 20210402 =over 4 +=item B + +Random testing produced case b1100 in which the output style produced +by the --opening-token-right flags interfered with counting line-ending +commas, and this in turn caused the -bbx flag to turn off the -xci flag. +This problem was fixed. + +15 Apr 2021. + =item B Random testing produced case b1097 with this parameter set -- 2.39.5