From 138457aa352cc216d8f385c392b6849275ec2455 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Mon, 22 Jul 2024 21:04:47 -0700 Subject: [PATCH] add 'state' to keyword list for -sak, see git #157 --- bin/perltidy | 4 ++-- lib/Perl/Tidy/Formatter.pm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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; -- 2.39.5