]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix issue b1455
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 15 Jun 2023 16:19:07 +0000 (09:19 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 15 Jun 2023 16:19:07 +0000 (09:19 -0700)
dev-bin/run_convergence_tests.pl.data
dev-bin/run_convergence_tests.pl.expect
lib/Perl/Tidy/Formatter.pm

index 91cd7a7c41467585803a7912d0a0a026eb6737ff..74c8fea3544eecb64300fb7b7097c565f14406db 100644 (file)
@@ -11560,6 +11560,36 @@ my $red_color = $widget->window->get_colormap->color_alloc( {
 --variable-maximum-line-length
 --weld-nested-containers
 
+==> b1455.in <==
+if ($BOLD_MATH) {
+    (
+       $labels, $comment,
+       join( '',
+                 '<B>', &make_math ( $mode, '', '', $_ ),
+                 '</B>', ),
+    )
+}
+
+if ($BOLD_MATH) {
+    (
+       $labels, $comment,
+       join(
+                 '', '<B>', &make_math ( $mode, '', '', $_ ),
+                 '</B>'
+       ),
+    )
+}
+
+==> b1455.par <==
+--add-trailing-commas
+--continuation-indentation=8
+--delete-trailing-commas
+--extended-continuation-indentation
+--line-up-parentheses
+--maximum-line-length=66
+--space-function-paren
+--want-trailing-commas='b'
+
 ==> b146.in <==
 # State 1
 
index 2ccfed81e50715b67cd8ee914873118621ddb2dc..231e3859663b0068a8eeb687ed01f2859879c460 100644 (file)
@@ -7042,8 +7042,8 @@ if (  ioctl (  STDERR, $TIOCGWINSZ,
           ...;
 }
 
-if (  ioctl (  STDERR, $TIOCGWINSZ, $winsize
-      )
+if (  ioctl (  STDERR, $TIOCGWINSZ,
+               $winsize )
   )
 {
           ...;
@@ -7102,28 +7102,24 @@ SOAP::Transport::HTTP::Daemon->new (LocalAddr => $host,
 
 ==> b1396 <==
      print 'not '
-       unless ( near (
-            great_circle_distance ( 0, 0, 0, pi / 2 ), pi / 2
-       ) );
+       unless ( near ( great_circle_distance ( 0, 0, 0, pi / 2 ),
+            pi / 2 ) );
 
      print 'not '
-       unless ( near (
-            great_circle_distance ( 0, 0, 0, pi / 2 ), pi / 2
-       ) );
+       unless ( near ( great_circle_distance ( 0, 0, 0, pi / 2 ),
+            pi / 2 ) );
 
 
 ==> b1397 <==
          (
-                  my $msg = sprintf (
-                           gettext("%s: fatal error at line %d:\n"), $progname, $line
-                      )
+                  my $msg = sprintf ( gettext("%s: fatal error at line %d:\n"),
+                           $progname, $line )
                       . "@_\n"
          ) =~ tr/\0//d;
 
          (
-                  my $msg = sprintf (
-                           gettext("%s: fatal error at line %d:\n"), $progname, $line
-                      )
+                  my $msg = sprintf ( gettext("%s: fatal error at line %d:\n"),
+                           $progname, $line )
                       . "@_\n"
          ) =~ tr/\0//d;
 
@@ -7831,6 +7827,25 @@ my $red_color =
                                                     blue  => 0
       } );
 
+==> b1455 <==
+if ($BOLD_MATH) {
+    (
+       $labels, $comment,
+       join( '',
+                 '<B>', &make_math ( $mode, '', '', $_ ),
+                 '</B>' ),
+    )
+}
+
+if ($BOLD_MATH) {
+    (
+       $labels, $comment,
+       join( '',
+                 '<B>', &make_math ( $mode, '', '', $_ ),
+                 '</B>' ),
+    )
+}
+
 ==> b146 <==
 # State 1
 
index 24f71b8ec9a035b86d5d7953c5700fe847b877e0..6e9a1ea7a82814daf43c73edf70eb3eb1cf63e80 100644 (file)
@@ -23999,6 +23999,12 @@ EOM
             }
         }
 
+        # Increase tol when -atc and -dtc are both used to allow for
+        # possible loss in length on next pass due to a comma. Fixes b1455.
+        if ( $rOpts_delete_trailing_commas && $rOpts_add_trailing_commas ) {
+            $tol += 1;
+        }
+
         my $i_opening_minus = $self->find_token_starting_list($i_opening_paren);
         my $excess =
           $self->excess_line_length( $i_opening_minus, $i_closing_paren );