From 8be3ef27bd1ca1c31561ba4e0d9792e10df3bf8d Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Wed, 30 Mar 2022 08:18:59 -0700 Subject: [PATCH] add log message that -gcs was used; fix bad log msg --- lib/Perl/Tidy.pm | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index 1e086079..cf25acd0 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -464,6 +464,9 @@ sub perltidy { # char_mode_used => true if text processed by perltidy in 'char' mode. # Normally true for text identified as utf8, otherwise false. + # This tells if Unicode::GCString was used + # gcs_used => true if -gcs and Unicode::GCString found & used + # These variables tell what utf8 decoding/encoding was done: # input_decoded_as => non-blank if perltidy decoded the source text # output_encoded_as => non-blank if perltidy encoded before return @@ -490,6 +493,7 @@ sub perltidy { char_mode_used => 0, input_decoded_as => "", output_encoded_as => "", + gcs_used => 0, iteration_count => 0, converged => 0, blinking => 0, @@ -1174,9 +1178,11 @@ EOM } } } - $encoding_log_message .= <new( $_[0] )->columns; }; + $encoding_log_message .= <{'gcs_used'} = 1; } } @@ -3635,7 +3645,14 @@ EOM } # entab leading whitespace has priority over the older 'tabs' option - if ( $rOpts->{'tabs'} ) { $rOpts->{'tabs'} = 0; } + if ( $rOpts->{'tabs'} ) { + + # The following warning could be added but would annoy a lot of + # users who have a perltidyrc with both -t and -et=n. So instead + # there is a note in the manual that -et overrides -t. + ##Warn("-tabs and -et=n confict; ignoring -tabs\n"); + $rOpts->{'tabs'} = 0; + } } # set a default tabsize to be used in guessing the starting indentation -- 2.39.5