]> git.donarmstrong.com Git - perltidy.git/commitdiff
Fix problem involving -bbx=2 -xci -osbr and similar -otr flags
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 16 Apr 2021 01:53:10 +0000 (18:53 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 16 Apr 2021 01:53:10 +0000 (18:53 -0700)
lib/Perl/Tidy/Formatter.pm
local-docs/BugLog.pod

index 01704ff6014dad6d311ba4ed57ed8db64cc4c828..6ef9eeca89f6cf4753cd06cf01444eb3674cfe5c 100644 (file)
@@ -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} ) {
 
index 3d8cb8afbb754d96c8af31e943aa25b5aaf7fd44..4ff950afc9f61e137abc2c7a304bc8798402aa72 100644 (file)
@@ -1,8 +1,16 @@
-
 =head1 Issues fixed after release 20210402
 
 =over 4
 
+=item B<Fix problem involving -bbx=2 -xci -osbr and similar -otr flags>
+
+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<Fix rare line break problem>
 
 Random testing produced case b1097 with this parameter set