From 20eafc23a2d2740fdb90d8ace4b94c6aaca3a911 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sun, 4 Sep 2022 15:13:24 -0700 Subject: [PATCH] fix issue b1375 --- dev-bin/run_convergence_tests.pl.data | 19 +++++++++++++++++++ lib/Perl/Tidy/Formatter.pm | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index 9ef02cc5..69e5d505 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -10143,6 +10143,25 @@ $font_size --maximum-line-length=12 --nowant-right-space='=' +==> b1375.in <== +# S1 + $self->{'col_ids'} ||= [ + $self->numbering .. $self->width() + $self->numbering - 1 ] + if ( defined( $self->width() ) && $self->width() > 0 ); + +# S2 + $self->{'col_ids'} ||= + [ $self->numbering .. $self->width() + + $self->numbering - 1 ] + if ( defined( $self->width() ) && $self->width() > 0 ); + +==> b1375.par <== +--extended-line-up-parentheses +--indent-columns=10 +--maximum-line-length=58 +--opening-square-bracket-right +--variable-maximum-line-length + ==> b140.in <== $cmd[ $i ]=[ $s, $e, $cmd, \@hunk, $i ] ; diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index c68b192a..2cd88c1a 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -26540,8 +26540,9 @@ sub set_vertical_tightness_flags { && $token_end ne '||' && $token_end ne '&&' # Keep break after '=' if -lp. Fixes b964 b1040 b1062 b1083 b1089. + # Generalized from '=' to $is_assignment to fix b1375. && !( - $token_end eq '=' + $is_assignment{ $types_to_go[$iend] } && $rOpts_line_up_parentheses && $self->[_rlp_object_by_seqno_] ->{ $type_sequence_to_go[$ibeg_next] } -- 2.39.5