diff options
author | Karl Berry <karl@freefriends.org> | 2023-05-20 20:19:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-05-20 20:19:20 +0000 |
commit | 966f5266f47369fceb572fa736ea9a975c86d8bd (patch) | |
tree | accd6c93996e158d896d2d6b733f3322231e3e13 /Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm | |
parent | 06cccdee5db849d30c6de6e7981c6015b7772342 (diff) |
latexindent (20may23)
git-svn-id: svn://tug.org/texlive/trunk@67174 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm')
-rw-r--r-- | Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm index c46d0c5164d..6b97e617375 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm @@ -26,7 +26,7 @@ use Cwd; use Exporter qw/import/; use LatexIndent::LogFile qw/$logger/; our @EXPORT_OK - = qw/yaml_read_settings yaml_modify_line_breaks_settings yaml_get_indentation_settings_for_this_object yaml_poly_switch_get_every_or_custom_value yaml_get_indentation_information yaml_get_object_attribute_for_indentation_settings yaml_alignment_at_ampersand_settings %mainSettings/; + = qw/yaml_read_settings yaml_modify_line_breaks_settings yaml_get_indentation_settings_for_this_object yaml_poly_switch_get_every_or_custom_value yaml_get_indentation_information yaml_get_object_attribute_for_indentation_settings yaml_alignment_at_ampersand_settings %mainSettings %previouslyFoundSettings/; # Read in defaultSettings.YAML file our $defaultSettings; @@ -818,6 +818,14 @@ sub yaml_get_indentation_settings_for_this_object { columns => ${$self}{columns}, ); + # text wrap 'after' information + if ( $is_m_switch_active + and ${ $mainSettings{modifyLineBreaks}{textWrapOptions} }{when} eq 'after' + and defined ${$self}{indentRule} ) + { + ${ ${previouslyFoundSettings}{textWrapAfter} }{$name} = $indentation; + } + # don't forget alignment settings! foreach (@alignAtAmpersandInformation) { ${ ${previouslyFoundSettings}{$storageName} }{ ${$_}{name} } = ${$self}{ ${$_}{name} } @@ -1091,11 +1099,27 @@ sub yaml_get_indentation_information { if ( defined $indentationInformation ) { if ( $indentationAbout eq "noAdditionalIndent" and $indentationInformation == 1 ) { $logger->trace("Found! Using '' (see $indentationAbout)") if $is_t_switch_active; + + # text wrapping 'after' requires knowledge of indent rules + # + if ( $is_m_switch_active + and ${ $mainSettings{modifyLineBreaks}{textWrapOptions} }{when} eq 'after' ) + { + ${$self}{indentRule} = $indentationInformation; + } return q(); } elsif ( $indentationAbout eq "indentRules" and $indentationInformation =~ m/^\h*$/ ) { $logger->trace("Found! Using '$indentationInformation' (see $indentationAbout)") if $is_t_switch_active; + + # text wrapping 'after' requires knowledge of indent rules + # + if ( $is_m_switch_active + and ${ $mainSettings{modifyLineBreaks}{textWrapOptions} }{when} eq 'after' ) + { + ${$self}{indentRule} = $indentationInformation; + } return $indentationInformation; } } @@ -1115,12 +1139,28 @@ sub yaml_get_indentation_information { { $logger->trace("$globalInformation specified for $YamlName (see $globalInformation)") if $is_t_switch_active; + + # text wrapping 'after' requires knowledge of indent rules + # + if ( $is_m_switch_active + and ${ $mainSettings{modifyLineBreaks}{textWrapOptions} }{when} eq 'after' ) + { + ${$self}{indentRule} = $indentationInformation; + } return q(); } elsif ( $globalInformation eq "indentRulesGlobal" ) { if ( ${ $mainSettings{$globalInformation} }{$YamlName} =~ m/^\h*$/ ) { $logger->trace("$globalInformation specified for $YamlName (see $globalInformation)") if $is_t_switch_active; + + # text wrapping 'after' requires knowledge of indent rules + # + if ( $is_m_switch_active + and ${ $mainSettings{modifyLineBreaks}{textWrapOptions} }{when} eq 'after' ) + { + ${$self}{indentRule} = $indentationInformation; + } return ${ $mainSettings{$globalInformation} }{$YamlName}; } elsif ( ${ $mainSettings{$globalInformation} }{$YamlName} ne '0' ) { |