diff options
Diffstat (limited to 'support/latexindent/LatexIndent/BlankLines.pm')
-rw-r--r-- | support/latexindent/LatexIndent/BlankLines.pm | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/support/latexindent/LatexIndent/BlankLines.pm b/support/latexindent/LatexIndent/BlankLines.pm index 2622e9ad90..a3e439d2e0 100644 --- a/support/latexindent/LatexIndent/BlankLines.pm +++ b/support/latexindent/LatexIndent/BlankLines.pm @@ -17,17 +17,16 @@ package LatexIndent::BlankLines; use strict; use warnings; use LatexIndent::Tokens qw/%tokens/; -use LatexIndent::GetYamlSettings qw/%masterSettings/; +use LatexIndent::GetYamlSettings qw/%mainSettings/; use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; use LatexIndent::LogFile qw/$logger/; use Exporter qw/import/; our @EXPORT_OK = qw/protect_blank_lines unprotect_blank_lines condense_blank_lines/; sub protect_blank_lines{ - return unless $is_m_switch_active; my $self = shift; - unless(${$masterSettings{modifyLineBreaks}}{preserveBlankLines}){ + unless(${$mainSettings{modifyLineBreaks}}{preserveBlankLines}){ $logger->trace("*Blank lines will not be protected (preserveBlankLines=0)") if $is_t_switch_active; return } @@ -38,18 +37,15 @@ sub protect_blank_lines{ } sub condense_blank_lines{ - return unless $is_m_switch_active; - - return unless ${$masterSettings{modifyLineBreaks}}{condenseMultipleBlankLinesInto}>0; my $self = shift; $logger->trace("*condense blank lines routine") if $is_t_switch_active; # if preserveBlankLines is set to 0, then the blank-line-token will not be present # in the document -- we change that here - if(${$masterSettings{modifyLineBreaks}}{preserveBlankLines}==0){ + if(${$mainSettings{modifyLineBreaks}}{preserveBlankLines}==0){ # turn the switch on - ${$masterSettings{modifyLineBreaks}}{preserveBlankLines}=1; + ${$mainSettings{modifyLineBreaks}}{preserveBlankLines}=1; # log file information $logger->trace("Updating body to include blank line token, this requires preserveBlankLines = 1") if($is_tt_switch_active); @@ -61,7 +57,7 @@ sub condense_blank_lines{ } # grab the value from the settings - my $condenseMultipleBlankLinesInto = ${$masterSettings{modifyLineBreaks}}{condenseMultipleBlankLinesInto}; + my $condenseMultipleBlankLinesInto = ${$mainSettings{modifyLineBreaks}}{condenseMultipleBlankLinesInto}; # grab the blank-line-token my $blankLineToken = $tokens{blanklines}; @@ -80,9 +76,6 @@ sub condense_blank_lines{ } sub unprotect_blank_lines{ - return unless $is_m_switch_active; - - return unless ${$masterSettings{modifyLineBreaks}}{preserveBlankLines}; my $self = shift; # remove any empty lines that might have been added by the text_wrap routine; see, for example, |