summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/latexindent
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/latexindent')
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm7
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm4
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm32
-rwxr-xr-xMaster/texmf-dist/scripts/latexindent/defaultSettings.yaml2
-rwxr-xr-xMaster/texmf-dist/scripts/latexindent/latexindent.pl2
5 files changed, 39 insertions, 8 deletions
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm
index 24e1291e754..96577d28d0a 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm
@@ -435,6 +435,13 @@ sub yaml_read_settings {
$logger->info(
"Not showing settings in the log file (see showEveryYamlRead and showAmalgamatedSettings).");
}
+
+ # warning to log file if modifyLineBreaks specified and m switch not active
+ if ( ${ $userSettings->[0] }{modifyLineBreaks} and !$is_m_switch_active ) {
+ $logger->warn("*modifyLineBreaks specified and m switch is *not* active");
+ $logger->warn("perhaps you intended to call");
+ $logger->warn(" latexindent.pl -m -l $settings ${$self}{fileName}");
+ }
}
else {
# otherwise print a warning that we can not read userSettings.yaml
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
index edbb6252aa5..5decf68ddd6 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.17.2';
-our $versionDate = '2022-04-14';
+our $versionNumber = '3.17.3';
+our $versionDate = '2022-06-05';
1
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm
index 1850a83c90d..7f3d026a4e6 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm
@@ -249,12 +249,36 @@ sub text_wrap {
# initiate the trailing comments storage
my $trailingComments = q();
- # grab all *internal* trailing comments from the block
- while ( $textWrapBlockStorageValue =~ m|$trailingCommentRegExp| ) {
- $textWrapBlockStorageValue =~ s|(\h*$trailingCommentRegExp)||s;
- $trailingComments .= $1;
+ # about trailing comments
+ #
+ # - trailing comments that do *not* have leading space instruct the text
+ # wrap routine to connect the lines *without* space
+ #
+ # - multiple trailing comments will be connected at the end of the text wrap block
+ #
+ # - the number of spaces between the end of the text wrap block and
+ # the (possibly combined) trailing comments is determined by the
+ # spaces (if any) at the end of the text wrap block
+
+ # for trailing comments that
+ #
+ # do *NOT* have a leading space
+ # do have a trailing line break
+ #
+ # then we *remove* the trailing line break
+ while ( $textWrapBlockStorageValue =~ m|\H$trailingCommentRegExp\h*\R|s ) {
+ $textWrapBlockStorageValue =~ s|(\H)($trailingCommentRegExp)\h*\R|$1$2|s;
+ }
+
+ # now we put all of the trailing comments together
+ while ( $textWrapBlockStorageValue =~ m|$trailingCommentRegExp|s ) {
+ $textWrapBlockStorageValue =~ s|($trailingCommentRegExp)||s;
+ $trailingComments = $trailingComments . $1;
}
+ $trailingComments =~ s/\h{2,}/ /sg
+ if ${ $mainSettings{modifyLineBreaks}{textWrapOptions} }{multipleSpacesToSingle};
+
# determine if text wrapping will remove paragraph line breaks
my $removeBlockLineBreaks = ${ $mainSettings{modifyLineBreaks}{textWrapOptions} }{removeBlockLineBreaks};
diff --git a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
index c64dd5aeae5..dd59a83531b 100755
--- a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
+++ b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
@@ -1,4 +1,4 @@
-# defaultSettings.yaml for latexindent.pl, version 3.17.2, 2022-04-14
+# defaultSettings.yaml for latexindent.pl, version 3.17.3, 2022-06-05
# a script that aims to
# beautify .tex, .sty, .cls files
#
diff --git a/Master/texmf-dist/scripts/latexindent/latexindent.pl b/Master/texmf-dist/scripts/latexindent/latexindent.pl
index f75b8165a5f..2915e567932 100755
--- a/Master/texmf-dist/scripts/latexindent/latexindent.pl
+++ b/Master/texmf-dist/scripts/latexindent/latexindent.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# latexindent.pl, version 3.17.2, 2022-04-14
+# latexindent.pl, version 3.17.3, 2022-06-05
#
# 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