]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix issue c087, follow break after anonymous sub closing brace
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 18 Oct 2021 00:18:17 +0000 (17:18 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 18 Oct 2021 00:18:17 +0000 (17:18 -0700)
lib/Perl/Tidy/Formatter.pm

index 13c5c9588de4281447ba8c763d56b45bc4b07ffd..3f04f031cb9838d7c457ca880bc684e381df7084 100644 (file)
@@ -12040,9 +12040,13 @@ EOM
                             $keep_going      = 1;
                         }
 
-                        # Exception 2: followed by '}' on next line
-                        elsif ( $Ktoken_vars == $K_last ) {
-
+                        # Exception 2: followed by '}' on next line if -lp set.
+                        # The -lp requirement allows the formatting to follow
+                        # old breaks when -lp is not used, minimizing changes.
+                        # Fixes issue c087.
+                        elsif ($Ktoken_vars == $K_last
+                            && $rOpts_line_up_parentheses )
+                        {
                             my $K_closing_container =
                               $self->[_K_closing_container_];
                             my $K_opening_container =