From: Steve Hancock Date: Tue, 20 Oct 2020 16:20:55 +0000 (-0700) Subject: modify filter rule to keep space between ? and # X-Git-Tag: 20201001.03~51 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0e794ed13a9ca9207730245e0b8046d1ff6f6d2c;p=perltidy.git modify filter rule to keep space between ? and # --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index d2761fee..801b6935 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -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; }