]> git.donarmstrong.com Git - perltidy.git/commitdiff
modify rule for outdenting non-container closing qw delimiters
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 24 Dec 2020 18:06:31 +0000 (10:06 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 24 Dec 2020 18:06:31 +0000 (10:06 -0800)
lib/Perl/Tidy/Formatter.pm
local-docs/BugLog.pod
t/snippets/expect/ndsm1.def
t/snippets/expect/ndsm1.ndsm
t/snippets16.t

index a3d24449bf7bef263d39f39a74900cd50f4874e5..6f66325416be40429c2484dd3cb7f76179bf75dd 100644 (file)
@@ -18983,15 +18983,22 @@ sub make_paren_name {
                     # A quote delimiter which is not a container will not have
                     # a cti value defined.  In this case use the style of a
                     # paren. For example
-                    #   my @words = (
-                    #      qw/
+                    #   my @fars = (
+                    #      qw<
                     #        far
                     #        farfar
                     #        farfars far
-                    #      /,
+                    #      >,
                     #   );
                     if ( !defined($cti) && length($tok) == 1 ) {
+
+                        # something other than ')', '}', ']' ; use flag for ')'
                         $cti = $closing_token_indentation{')'};
+
+                        # But for now, do not outdent non-container qw
+                        # delimiters because it would would change existing
+                        # formatting.
+                        if ( $tok ne '>' ) { $cti = 3 }
                     }
 
                     # A non-welded closing qw cannot currently use -cti=1
index e7ff6522dda9b7e93c4c6fc6e64af91431f8d644..73a5d7c9caade4c316bd5657f3c974b1d704c373 100644 (file)
@@ -76,21 +76,34 @@ followed the default -cpi setting for a paren:
     );
 
 This update makes closing qw quote terminators follow the settings for their
-corresponding container tokens as closely as possible.  In addition, for
-closing quote tokens which are not containers, the setting for a closing paren
-will now be followed.  For example
+corresponding container tokens as closely as possible.  For a closing '>'
+the setting for a closing paren will now be followed.  Other closing qw 
+terminators will remain indented, to minimize changes to existing formatting.  
+For example ('>' is outdented):
 
     @EXPORT = (
-        qw#
+        qw<
           i Re Im rho theta arg
           sqrt log ln
           log10 logn cbrt root
           cplx cplxe
-        #,
+        >,
         @trig
     );
 
-This update was added 18 Dec 2020.
+but (';' remains indented):
+
+    @EXPORT = (
+        qw;
+          i Re Im rho theta arg
+          sqrt log ln
+          log10 logn cbrt root
+          cplx cplxe
+          ;,
+        @trig
+    );
+
+This update was added 18 Dec 2020 and modified 24 Dec.
 
 =item B<Update manual pages regarding issue git #50>
 
index c2b812f355a2bae570ae66894b09c5891ddd04cc..c36b944f99f8b40567a291cc788690058594a07f 100644 (file)
@@ -4,5 +4,5 @@ sub numerically { $a <=> $b }
 sub Numerically { $a <=> $b };    # trapped semicolon
 @: = qw;2c72656b636168
   2020202020
-;;
+  ;;
 __;
index e79a123f1712b10129c91bbad8d8d9253cc75400..d5e53dd9d64d2d9e2ff85ffa1853d9eb9ecd1a40 100644 (file)
@@ -12,5 +12,5 @@ sub numerically { $a <=> $b };
 sub Numerically { $a <=> $b };    # trapped semicolon
 @: = qw;2c72656b636168
   2020202020
-;;
+  ;;
 __;
index d70fc960dc018c70d98ed0927b50740d7ba7051a..5951bf608d8b67a369bcf5dd45cabddc0781ac66 100644 (file)
@@ -355,7 +355,7 @@ sub numerically { $a <=> $b }
 sub Numerically { $a <=> $b };    # trapped semicolon
 @: = qw;2c72656b636168
   2020202020
-;;
+  ;;
 __;
 #14...........
         },
@@ -378,7 +378,7 @@ sub numerically { $a <=> $b };
 sub Numerically { $a <=> $b };    # trapped semicolon
 @: = qw;2c72656b636168
   2020202020
-;;
+  ;;
 __;
 #15...........
         },