From c82cc412b778aa6a5dae53bfedf2db75821ae2d0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 30 Oct 2021 19:41:07 +0000 Subject: latexindent (30oct21) git-svn-id: svn://tug.org/texlive/trunk@60905 c570f23f-e606-0410-a88d-b1316a301751 --- .../LatexIndent/AlignmentAtAmpersand.pm | 29 +++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm') diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm index c015e08a871..22de133bf13 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm @@ -61,23 +61,22 @@ sub find_aligned_block{ (?!<\\) % \* - \h* # possible horizontal spaces + \h* # possible horizontal spaces \\begin\{ - $alignmentBlock # environment name captured into $2 - \} # %* \begin{alignmentBlock} statement + ($alignmentBlock) # environment name captured into $2 + \} # \begin{alignmentBlock} statement captured into $1 ) ( - .*? + .*? # non-greedy match (body) into $3 ) - \R - \h* + \R # a line break + \h* # possible horizontal spaces ( (?!<\\) - %\* # % - \h* # possible horizontal spaces - \\end\{$alignmentBlock\} # \end{alignmentBlock} - ) # %* \end{} statement - #\R + %\* # % + \h* # possible horizontal spaces + \\end\{\2\} # \end{alignmentBlock} statement captured into $4 + ) /sx; while( ${$self}{body} =~ m/$alignmentRegExp/sx){ @@ -87,9 +86,9 @@ sub find_aligned_block{ / # create a new Environment object my $alignmentBlockObj = LatexIndent::AlignmentAtAmpersand->new( begin=>$1, - body=>$2, - end=>$3, - name=>$alignmentBlock, + body=>$3, + end=>$4, + name=>$2, modifyLineBreaksYamlName=>"environments", linebreaksAtEnd=>{ begin=>1, @@ -99,7 +98,7 @@ sub find_aligned_block{ ); # log file output - $logger->trace("*Alignment block found: %*\\begin\{$alignmentBlock\}") if $is_t_switch_active; + $logger->trace("*Alignment block found: %*\\begin\{${$alignmentBlock}{name}\}") if $is_t_switch_active; # the settings and storage of most objects has a lot in common $self->get_settings_and_store_new_object($alignmentBlockObj); -- cgit v1.2.3