From: Steve Hancock Date: Tue, 23 Jul 2024 04:04:47 +0000 (-0700) Subject: add 'state' to keyword list for -sak, see git #157 X-Git-Tag: 20240511.07~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=138457aa352cc216d8f385c392b6849275ec2455;p=perltidy.git add 'state' to keyword list for -sak, see git #157 --- diff --git a/bin/perltidy b/bin/perltidy index 488fed8d..7d4dd41f 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -1552,8 +1552,8 @@ binary operator asymmetrically with a space on the left but not on the right. When an opening paren follows a Perl keyword, no space is introduced after the keyword, unless it is (by default) one of these: - my local our and or xor eq ne if else elsif until unless - while for foreach return switch case given when + my local our state and or xor err eq ne if else elsif until unless + while for foreach return switch case given when catch These defaults can be modified with two commands: diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 6bbbe8ac..7fa1ae68 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -1999,7 +1999,7 @@ sub initialize_space_after_keyword { # default keywords for which space is introduced before an opening paren # (at present, including them messes up vertical alignment) - my @sak = qw(my local our and or xor err eq ne if else elsif until + my @sak = qw(my local our state and or xor err eq ne if else elsif until unless while for foreach return switch case given when catch); %space_after_keyword = map { $_ => 1 } @sak;