From: Steve Hancock Date: Mon, 18 Oct 2021 00:18:17 +0000 (-0700) Subject: fix issue c087, follow break after anonymous sub closing brace X-Git-Tag: 20211029~10 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f05e6b56b46500eae51eae040fbf3f4cb7671f2e;p=perltidy.git fix issue c087, follow break after anonymous sub closing brace --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 13c5c958..3f04f031 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -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 =