]> git.donarmstrong.com Git - perltidy.git/commitdiff
fixed problem with breaking at a equals
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 12 Feb 2021 15:21:34 +0000 (07:21 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 12 Feb 2021 15:21:34 +0000 (07:21 -0800)
lib/Perl/Tidy/Formatter.pm
local-docs/BugLog.pod

index 55aff87789f1329cdff606e4b0b4b11b0b88bb49..5a1c86b70392f229f31074794e3050f0e6801006 100644 (file)
@@ -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)
 
index ac9e82133bf9060211f85116cd0747d28b98f49d..c47dba664601444c2dedf97af8878b3d66b7db88 100644 (file)
@@ -2,6 +2,17 @@
 
 =over 4
 
+=item B<Fix problem with breaking at an = sign>
+
+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<Fix conflict of -kbl=0 and essential space after =cut>
 
 Random testing produced a case where a blank line after an =cut