From: Steve Hancock Date: Thu, 15 Jun 2023 16:19:07 +0000 (-0700) Subject: fix issue b1455 X-Git-Tag: 20230309.04~8 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b92b61dbb34355301891116e6271e45f066e9312;p=perltidy.git fix issue b1455 --- diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index 91cd7a7c..74c8fea3 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -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( '', + '', &make_math ( $mode, '', '', $_ ), + '', ), + ) +} + +if ($BOLD_MATH) { + ( + $labels, $comment, + join( + '', '', &make_math ( $mode, '', '', $_ ), + '' + ), + ) +} + +==> 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 diff --git a/dev-bin/run_convergence_tests.pl.expect b/dev-bin/run_convergence_tests.pl.expect index 2ccfed81..231e3859 100644 --- a/dev-bin/run_convergence_tests.pl.expect +++ b/dev-bin/run_convergence_tests.pl.expect @@ -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( '', + '', &make_math ( $mode, '', '', $_ ), + '' ), + ) +} + +if ($BOLD_MATH) { + ( + $labels, $comment, + join( '', + '', &make_math ( $mode, '', '', $_ ), + '' ), + ) +} + ==> b146 <== # State 1 diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 24f71b8e..6e9a1ea7 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -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 );