]> git.donarmstrong.com Git - perltidy.git/commitdiff
add scope-limiting parens to regex to fix git #142
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 13 May 2024 22:37:14 +0000 (15:37 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 13 May 2024 22:37:14 +0000 (15:37 -0700)
lib/Perl/Tidy/Formatter.pm

index 9059378cb220da79d9e07b785d988bbce082e868..770a477eba518a67143fd6d1fe7de1d972dca518 100644 (file)
@@ -2971,13 +2971,13 @@ EOM
         $pos_last = pos($opt_style);
         if (
             $opt_style =~ m{
-             \G
+             \G(?:      #    fix git #142
                (\s+)    # 1. whitespace
              | ([\}\]]) # 2. closing bracket
              | (->)     # 3. arrow
              | ([\[\{]) # 4. opening bracket
              | (.*)     # 5. something else, error
-
+             )
             }gcx
           )
         {