]> git.donarmstrong.com Git - perltidy.git/commitdiff
modify filter rule to keep space between ? and #
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 20 Oct 2020 16:20:55 +0000 (09:20 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 20 Oct 2020 16:20:55 +0000 (09:20 -0700)
lib/Perl/Tidy/Formatter.pm

index d2761feedecd496c8ccf7dbe9c073886145edb18..801b693538cdc41ade67dacb661b83a5064584fe 100644 (file)
@@ -2233,8 +2233,14 @@ EOM
         #       ) #foo)))
         #       { ... }
 
+        # Also, I prefer not to put a ? and # together because ? used to be
+        # a pattern delmiter and spacing was used if guessing was needed.
+
         if ($typer eq '#' ) {
-            return 1 if ($tokenl && substr($tokenl,-1) eq '$');
+
+            return 1
+              if ( $tokenl
+                && ( $typel eq '?' || substr( $tokenl, -1 ) eq '$' ) );
             return;
         }