From 5648c591296b0284348f3585ce128fea85e2fcc6 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Thu, 8 Oct 2020 11:40:06 -0700 Subject: [PATCH] fix -xci to work with -lp --- lib/Perl/Tidy/Formatter.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 2080b03d..cdaef1c1 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -16617,8 +16617,13 @@ sub get_seqno { my $Kbeg = $K_to_go[$ibeg]; my $seqno = $rseqno_which_extended_ci->{$Kbeg}; if ( $seqno && $undo_extended_ci{$seqno} ) { - $ci_levels_to_go[$ibeg] = 0; - $leading_spaces_to_go[$ibeg] = $reduced_spaces_to_go[$ibeg]; + + # but do not undo ci set by the -lp flag + if ( !ref( $reduced_spaces_to_go[$ibeg] ) ) { + $ci_levels_to_go[$ibeg] = 0; + $leading_spaces_to_go[$ibeg] = + $reduced_spaces_to_go[$ibeg]; + } } } -- 2.39.5