diff options
Diffstat (limited to 'support/latexindent/LatexIndent/TrailingComments.pm')
-rw-r--r-- | support/latexindent/LatexIndent/TrailingComments.pm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/support/latexindent/LatexIndent/TrailingComments.pm b/support/latexindent/LatexIndent/TrailingComments.pm index bbae745d94..748d005f98 100644 --- a/support/latexindent/LatexIndent/TrailingComments.pm +++ b/support/latexindent/LatexIndent/TrailingComments.pm @@ -67,16 +67,16 @@ sub remove_trailing_comments { $logger->trace("*Storing trailing comments") if $is_t_switch_active; my $notPreceededBy = qr/${${$mainSettings{fineTuning}}{trailingComments}}{notPreceededBy}/; + my $afterComment = qr/${${$mainSettings{fineTuning}}{trailingComments}}{afterComment}/; # perform the substitution ${$self}{body} =~ s/ - $notPreceededBy # not preceded by a \ - % # % + $notPreceededBy # not preceded by a \ + % # % ( - \h*? # followed by possible horizontal space - .*? # and anything else + $afterComment # anything else ) - $ # up to the end of a line + $ # up to the end of a line / # increment comment counter and store comment $commentCounter++; |