From ab9ad3996b8ab9379e4ce0046b2bd370ac64d7ac Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sat, 28 Aug 2021 09:47:55 -0700 Subject: [PATCH] Fix formatting instability issues b1195, b1196 --- dev-bin/run_convergence_tests.pl.data | 20 ++++++++++++++++++++ lib/Perl/Tidy/Formatter.pm | 5 ----- local-docs/BugLog.pod | 7 +++++++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/dev-bin/run_convergence_tests.pl.data b/dev-bin/run_convergence_tests.pl.data index 1f63ba01..237239a4 100644 --- a/dev-bin/run_convergence_tests.pl.data +++ b/dev-bin/run_convergence_tests.pl.data @@ -7184,6 +7184,26 @@ print --paren-vertical-tightness=2 --weld-nested-containers +==> b1196.in <== +# S1 +ok( + $strX eq + NFC( join( '', @strX ) ) +); +# S2 +ok( + $strX eq NFC( join( '', + @strX ) ) +); + +==> b1196.par <== +--continuation-indentation=9 +--extended-continuation-indentation +--ignore-old-breakpoints +--indent-columns=8 +--maximum-line-length=42 +--weld-nested-containers + ==> b120.in <== # Same as bug96 # State 1 diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 7628237a..d924e9bd 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -7542,11 +7542,6 @@ sub setup_new_weld_measurements { my $Kprev = $self->K_previous_nonblank($Kfirst); if ( defined($Kprev) ) { - # The -iob and -wn flags do not work well together. To avoid - # blinking states we have to override -iob at certain key line - # breaks. - $self->[_ris_essential_old_breakpoint_]->{$Kprev} = 1; - # Avoid measuring from between an opening paren and a previous token # which should stay close to it ... fixes b1185 my $token_oo = $rLL->[$Kouter_opening]->[_TOKEN_]; diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index 9abfecad..1acb6c0b 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,6 +2,13 @@ =over 4 +=item B + +Testing with random parameters produced two similar cases of unstable +formatting which are fixed with this update. + +28 Aug 2021. + =item B Testing with random parameters produced a case of unstable formatting -- 2.39.5