From f9a8543fd5e08040e5471b774c19899eea21004d Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Fri, 12 Feb 2021 07:21:34 -0800 Subject: [PATCH] fixed problem with breaking at a equals --- lib/Perl/Tidy/Formatter.pm | 7 ++++++- local-docs/BugLog.pod | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 55aff877..5a1c86b7 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -14568,7 +14568,12 @@ sub set_continuation_breaks { # the loop because if we are at a closing token (such # as '}') which forms a one-line block, this break might # get undone. - $want_previous_breakpoint = $i; + + # And do not do this at an equals if the user wants breaks + # before an equals (blinker cases b434 b903) + unless ($type eq '=' && $want_break_before{$type}) { + $want_previous_breakpoint = $i; + } } ## end if ( $next_nonblank_type...) } ## end if ($rOpts_break_at_old_keyword_breakpoints) diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index ac9e8213..c47dba66 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,6 +2,17 @@ =over 4 +=item B + +Random testing produced some blinking cases which were related to +detecting an old good breakpoint at an equals. If the user requested that +a break be done before an equals, and the input script had a break +after an equals, then that break should not have been marked as +a good existing break point before a keyword. This update +fixes cases b434 b903. + +11 Feb 2021. + =item B Random testing produced a case where a blank line after an =cut -- 2.39.5