diff options
author | Karl Berry <karl@freefriends.org> | 2023-07-02 20:17:33 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-07-02 20:17:33 +0000 |
commit | 61ba60d076491040a8ef3aa8f80cea962380c94c (patch) | |
tree | 568727347731fce4d96a453b860b48bc228c7edb /Master/texmf-dist/scripts/latexindent | |
parent | f151722c19f74fb7633845767139f7d487bc8328 (diff) |
latexindent (2jul23)
git-svn-id: svn://tug.org/texlive/trunk@67531 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/latexindent')
4 files changed, 16 insertions, 8 deletions
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm index f7ed57cf8d9..ae69bb7928d 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.22'; -our $versionDate = '2023-06-01'; +our $versionNumber = '3.22.1'; +our $versionDate = '2023-07-02'; 1 diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm index dc99170452f..c600d28e188 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm @@ -63,7 +63,7 @@ sub text_wrap { /sx; } elsif ( $blocksFollowEachPart eq "commentOnPreviousLine" ) { - $blocksFollowEachPart = qr/^$trailingCommentRegExp/m; + $blocksFollowEachPart = qr/(?:^\h*$trailingCommentRegExp\R?)+/m; } elsif ( $blocksFollowEachPart eq "verbatim" ) { $blocksFollowEachPart = qr/$tokens{verbatim}\d+$tokens{endOfToken}/; @@ -103,7 +103,7 @@ sub text_wrap { elsif ( $blocksFollowEachPart eq "other" ) { $blocksFollowEachPart = qr/$yesNo/x; } - $blocksFollow .= ( $blocksFollow eq '' ? q() : "|" ) . qr/$blocksFollowEachPart/sx; + $blocksFollow .= ( $blocksFollow eq '' ? q() : "|" ) . qr/$blocksFollowEachPart/s; } } @@ -118,7 +118,13 @@ sub text_wrap { } # followed by 0 or more h-space and line breaks - $blocksFollow = ( $blocksFollow eq '' ? q() : qr/(?:$blocksFollow)(?:\h|\R)*/sx ); + if ( ${ ${ $mainSettings{modifyLineBreaks}{textWrapOptions} }{blocksFollow} }{commentOnPreviousLine} ) { + $blocksFollow + = ( $blocksFollow eq '' ? q() : qr/(?:$blocksFollow)(?:\h|\R)*(?:$trailingCommentRegExp\R\h*)?/s ); + } + else { + $blocksFollow = ( $blocksFollow eq '' ? q() : qr/(?:$blocksFollow)(?:\h|\R)*/s ); + } $logger->trace("textWrap blocks follow regexp:") if ( $is_tt_switch_active and ${$self}{modifyLineBreaksYamlName} ne 'sentence' ); @@ -181,7 +187,7 @@ sub text_wrap { $logger->trace( "textWrap Blocks ENDS with commentOnOwnLine (see textWrap:blocksEndBefore:commentOnOwnLine)") if $is_t_switch_active; - $blocksEndBeforeEachPart = qr/^$trailingCommentRegExp/m; + $blocksEndBeforeEachPart = qr/^\h*$trailingCommentRegExp/m; } elsif ( $blocksEndBeforeEachPart eq "verbatim" ) { $logger->trace("textWrap Blocks ENDS with verbatim (see textWrap:blocksEndBefore:verbatim)") @@ -326,6 +332,8 @@ sub text_wrap { else { my $thingToMeasure = ( split( /\R/, $textWrapBlockStorage[ $textWrapBlockCount - 1 ] ) )[-1]; $thingToMeasure =~ s/$tokens{blanklines}//; + $thingToMeasure =~ s/$tokens{verbatim}//; + $thingToMeasure =~ s/$trailingCommentRegExp//; $subsequentSpace = ( $textWrapBlockCount == 0 diff --git a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml index 9d16992e360..e626458b63f 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.22, 2023-06-01 +# latexindent.pl, version 3.22.1, 2023-07-02 # # defaultSettings.yaml, the default settings for latexindent.pl # diff --git a/Master/texmf-dist/scripts/latexindent/latexindent.pl b/Master/texmf-dist/scripts/latexindent/latexindent.pl index 5dacf0bc84d..a4cf71ab954 100755 --- a/Master/texmf-dist/scripts/latexindent/latexindent.pl +++ b/Master/texmf-dist/scripts/latexindent/latexindent.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl # -# latexindent.pl, version 3.22, 2023-06-01 +# latexindent.pl, version 3.22.1, 2023-07-02 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by |