From 0e794ed13a9ca9207730245e0b8046d1ff6f6d2c Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Tue, 20 Oct 2020 09:20:55 -0700 Subject: [PATCH] modify filter rule to keep space between ? and # --- lib/Perl/Tidy/Formatter.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; } -- 2.39.5