summaryrefslogtreecommitdiff
path: root/support/latexindent/LatexIndent/TrailingComments.pm
diff options
context:
space:
mode:
Diffstat (limited to 'support/latexindent/LatexIndent/TrailingComments.pm')
-rw-r--r--support/latexindent/LatexIndent/TrailingComments.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/support/latexindent/LatexIndent/TrailingComments.pm b/support/latexindent/LatexIndent/TrailingComments.pm
index 7d03349c52..82ff154c87 100644
--- a/support/latexindent/LatexIndent/TrailingComments.pm
+++ b/support/latexindent/LatexIndent/TrailingComments.pm
@@ -99,7 +99,9 @@ sub put_trailing_comments_back_in{
# the -m switch can modify max characters per line, and trailing comment IDs can
# be split across lines
- if($is_m_switch_active and ${$self}{body} !~ m/%$trailingcommentID/m){
+ if($is_m_switch_active
+ and ${$mainSettings{modifyLineBreaks}{textWrapOptions}}{huge} ne "overflow"
+ and ${$self}{body} !~ m/%$trailingcommentID/m){
$logger->trace("$trailingcommentID not found in body using /m matching, assuming it has been split across line (see modifyLineBreaks: textWrapOptions)") if($is_t_switch_active);
my $trailingcommentIDwithLineBreaks;
@@ -126,6 +128,8 @@ sub put_trailing_comments_back_in{
/mx and $1 ne ''){
$logger->trace("Comment not at end of line $trailingcommentID, moving it to end of line")if $is_t_switch_active;
${$self}{body} =~ s/%$trailingcommentID(.*)$/$1%$trailingcommentValue/m;
+ #####if(${$self}{body} =~ m/%$trailingcommentID\h*[^%]+?$/mx){
+ ##### $logger->trace("Comment not at end of line $trailingcommentID, moving it to end of line") if $is_t_switch_active;
} else {
${$self}{body} =~ s/%$trailingcommentID/%$trailingcommentValue/;
}