From: Steve Hancock Date: Fri, 12 Feb 2021 15:21:34 +0000 (-0800) Subject: fixed problem with breaking at a equals X-Git-Tag: 20210402~52 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f9a8543fd5e08040e5471b774c19899eea21004d;p=perltidy.git fixed problem with breaking at a equals --- 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