Hello,
I’m searching how to indent the code after case :
, but currently anything works.
I’ve tried to do the same thing like that (Switch/Case block indentation), but there is no Indentation.tmPreferences
for PHP. I’ve created a new file, named Indentationswitchcase.tmPreferences
and stored in Packages/User
, with this code :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Indentation</string>
<key>scope</key>
<string>text.php</string>
<key>settings</key>
<dict>
<key>decreaseIndentPattern</key>
<string>(?x)
</string>
<key>increaseIndentPattern</key>
<string>(?x)
^\s* case.*: $
</string>
</dict>
<key>uuid</key>
<string>E44DC773-540C-4E3E-BF94-9E0C7A0C98DF</string>
</dict>
</plist>
but that doesn’t work.
I’ve tested with :
(?:
^\s*case.*:\s*$
)
or
(?:
^\s* case.*: $
)
but nothing seems to work.
Is there somebody who has already done this ?
Thanks in advance