From 9385e3dde9ffb6ffc7dcb555b9d4bc0afd1d47b4 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 24 Sep 2023 20:23:55 +0000 Subject: latexindent (24sep23) git-svn-id: svn://tug.org/texlive/trunk@68362 c570f23f-e606-0410-a88d-b1316a301751 --- .../scripts/latexindent/LatexIndent/Special.pm | 27 ++++++++++++++-------- .../scripts/latexindent/LatexIndent/Version.pm | 4 ++-- .../scripts/latexindent/defaultSettings.yaml | 9 ++++---- .../texmf-dist/scripts/latexindent/latexindent.pl | 2 +- 4 files changed, 25 insertions(+), 17 deletions(-) (limited to 'Master/texmf-dist/scripts/latexindent') diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm index f68db3400ba..096d2935c96 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm @@ -71,14 +71,23 @@ sub construct_special_begin { next; } + # body of specialBeginEnd + my $specialBodyRegEx = q(); + if ( defined ${$BeginEnd}{body} ) { + $specialBodyRegEx = qr/${$BeginEnd}{body}/; + } + else { + $specialBodyRegEx = qr/(?: # cluster-only (), don't capture + (?! + (?:$specialBegins) # cluster-only (), don't capture + ). # any character, but not anything in $specialBegins + )*?/sx; + } + # the overall regexp $specialAllMatchesRegExp .= ( $specialAllMatchesRegExp eq "" ? q() : "|" ) . qr/ ${$BeginEnd}{begin} - (?: # cluster-only (), don't capture - (?! - (?:$specialBegins) # cluster-only (), don't capture - ). # any character, but not anything in $specialBegins - )*? + $specialBodyRegEx ${$BeginEnd}{end} /sx; @@ -90,11 +99,7 @@ sub construct_special_begin { (\R*)? ) ( - (?: # cluster-only (), don't capture - (?! - (?:$specialBegins) # cluster-only (), don't capture - ). # any character, but not anything in $specialBegins - )*? + $specialBodyRegEx (\R*)? ) ( @@ -252,6 +257,8 @@ sub tasks_particular_to_each_object { } + $self->find_special; + return unless ( ${ $mainSettings{specialBeginEnd} }{specialBeforeCommand} ); # lookForAlignDelims: lookForChildCodeBlocks set to 0 means no child objects searched for diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm index 6da4d24cf77..684b37c3c9a 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm @@ -20,6 +20,6 @@ use warnings; use Exporter qw/import/; our @EXPORT_OK = qw/$versionNumber $versionDate/; -our $versionNumber = '3.23.1'; -our $versionDate = '2023-09-13'; +our $versionNumber = '3.23.2'; +our $versionDate = '2023-09-23'; 1 diff --git a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml index 8ee2b7a2fb5..a3c04edf3af 100755 --- a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml +++ b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml @@ -1,5 +1,5 @@ # -# latexindent.pl, version 3.23.1, 2023-09-13 +# latexindent.pl, version 3.23.2, 2023-09-23 # # defaultSettings.yaml, the default settings for latexindent.pl # @@ -258,15 +258,16 @@ itemNames: specialBeginEnd: displayMath: begin: (?