From: Steve Hancock Date: Tue, 5 Oct 2021 14:26:47 +0000 (-0700) Subject: fix issue b1219 X-Git-Tag: 20211029~35 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=001f074bbdf4e71ad638f2dd59b88c04ba38cf63;p=perltidy.git fix issue b1219 --- diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index 06a9c889..84ba8128 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -7530,6 +7530,32 @@ is( Koha::Acquisition::Funds->search->count, --maximum-line-length=50 --variable-maximum-line-length +==> b1219.in <== +# S1 +subtest 'check_password hook tests'=>sub{ + ok( $patron->set_password({password=>'explosion',skip_validation=>1} ), + 'Patron password updated via skip validation' ); +}; + +#S2 +subtest 'check_password hook tests'=>sub{ + ok( + $patron->set_password({password=>'explosion',skip_validation=>1} ), + 'Patron password updated via skip validation' ); +}; + +==> b1219.par <== +--noadd-whitespace +--continuation-indentation=4 +--delete-old-whitespace +--extended-continuation-indentation +--indent-columns=9 +--line-up-parentheses +--maximum-line-length=84 +--vertical-tightness-closing=2 +--vertical-tightness=1 +--weld-nested-containers + ==> b1220.in <== # S1 print$msg, diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 8c839601..7a15d311 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -8386,53 +8386,15 @@ EOM # An existing one-line weld is a line in which # (1) the containers are all on one line, and - # (2) the line does not exceed the allowable length, and - # (3) is not created with -lp -vt=n instead of welding - # This flag is used to avoid creating blinkers. - # FIX1: Changed 'excess_length_to_K' to 'excess_length_of_line' - # to get exact lengths and fix b604 b605. + # (2) the line does not exceed the allowable length if ( $iline_oo == $iline_oc ) { # All the tokens are on one line, now check their length my $excess = $self->excess_line_length_for_Krange( $Kfirst, $Klast ); - if ( $excess <= 0 ) { - - # All tokens are on one line and fit. This is a valid - # existing one-line weld except for some edge cases - # involving -lp: - - # FIX2: Patch for b1114: add a tolerance of one level if - # this line has an unbalanced start. This helps prevent - # blinkers in unusual cases for lines near the length limit - # by making it more likely that RULE 2 will prevent a weld. - # FIX3: for b1131: only use level difference in -lp mode. - # FIX4: for b1141, b1142: reduce the tolerance for longer - # leading tokens - if ( $rOpts_line_up_parentheses - && $outer_opening->[_LEVEL_] - - $rLL->[$Kfirst]->[_LEVEL_] ) - { - # We only need a tolerance if the leading text before - # the first opening token is shorter than the - # indentation length. For simplicity we just use the - # length of the first token here. If necessary, we - # could be more exact in the future and find the - # total length up to the first opening token. - # See cases b1114, b1141, b1142. - my $tolx = max( 0, - $rOpts_indent_columns - - $rLL->[$Kfirst]->[_TOKEN_LENGTH_] ); - - if ( $excess + $tolx <= 0 ) { - $is_one_line_weld = 1; - } - } - else { - $is_one_line_weld = 1; - } - } + # Note: coding simplified here for case b1219 + $is_one_line_weld = $excess <= 0; } # DO-NOT-WELD RULE 1: @@ -13080,7 +13042,9 @@ EOM $this_batch->[_do_not_pad_] = 0; $this_batch->[_batch_count_] = $batch_count; $this_batch->[_rix_seqno_controlling_ci_] = []; + $self->send_lines_to_vertical_aligner(); + my $level = $levels_to_go[$ibeg]; $self->[_last_last_line_leading_level_] = $self->[_last_line_leading_level_]; diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index b604e1bb..20d8f755 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -7058,7 +7058,7 @@ sub scan_identifier_do { # shouldn't happen: bad call parameter Fault(<