From f05e6b56b46500eae51eae040fbf3f4cb7671f2e Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sun, 17 Oct 2021 17:18:17 -0700 Subject: [PATCH] fix issue c087, follow break after anonymous sub closing brace --- lib/Perl/Tidy/Formatter.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 = -- 2.39.5