summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-05-20 20:19:20 +0000
committerKarl Berry <karl@freefriends.org>2023-05-20 20:19:20 +0000
commit966f5266f47369fceb572fa736ea9a975c86d8bd (patch)
treeaccd6c93996e158d896d2d6b733f3322231e3e13 /Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm
parent06cccdee5db849d30c6de6e7981c6015b7772342 (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.pm42
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' ) {