summaryrefslogtreecommitdiff
path: root/support/latexindent/LatexIndent/Indent.pm
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-11-07 03:00:56 +0000
committerNorbert Preining <norbert@preining.info>2020-11-07 03:00:56 +0000
commitec3426946c37f270d71e8c4ad19d37beea726e7d (patch)
tree4f9a4ffaa8d056d3d160ba1be76408a2e20d6fb7 /support/latexindent/LatexIndent/Indent.pm
parentac4210da60306c356c4f9344b65e1f8345314267 (diff)
CTAN sync 202011070300
Diffstat (limited to 'support/latexindent/LatexIndent/Indent.pm')
-rw-r--r--support/latexindent/LatexIndent/Indent.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/support/latexindent/LatexIndent/Indent.pm b/support/latexindent/LatexIndent/Indent.pm
index eb36db2108..ffb4d3f737 100644
--- a/support/latexindent/LatexIndent/Indent.pm
+++ b/support/latexindent/LatexIndent/Indent.pm
@@ -108,9 +108,6 @@ sub indent_begin{
sub indent_body{
my $self = shift;
- # grab the indentation of the object
- my $indentation = ${$self}{indentation};
-
# output to the logfile
$logger->trace("Body (${$self}{name}) before indentation:\n${$self}{body}") if $is_tt_switch_active;
@@ -123,6 +120,11 @@ sub indent_body{
# some objects can format their body to align at the & character
$self->align_at_ampersand if ${$self}{lookForAlignDelims};
+ # grab the indentation of the object
+ # NOTE: we need this here, as ${$self}{indentation} can be updated by the align_at_ampersand routine,
+ # see https://github.com/cmhughes/latexindent.pl/issues/223 for example
+ my $indentation = ${$self}{indentation};
+
# possibly remove paragraph line breaks
$self->remove_paragraph_line_breaks if ($is_m_switch_active and ${$self}{removeParagraphLineBreaks} and !${$masterSettings{modifyLineBreaks}{removeParagraphLineBreaks}}{beforeTextWrap});