Skip to content

Commit 1cb4c3e

Browse files
keith-hallwbond
authored andcommitted
[PHP] fix bug whereby indentation isn't decreased with <? } (#1548)
1 parent ec221cb commit 1cb4c3e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

PHP/Indentation Rules.tmPreferences

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
<dict>
1010
<key>decreaseIndentPattern</key>
1111
<string><![CDATA[(?x)
12+
^ # the start of the line
1213
(
13-
^ # start of the line
14-
(.*\*/)? # optionally with an end block comment somewhere on the line
15-
\s* [}\])] # optionally followed by whitespace, followed by a closing curly brace, square bracket or paren
14+
(
15+
.*\*/ # with an end block comment somewhere on the line
16+
| \s* (<\?(php)?\s+)? # OR a PHP open tag
17+
)? # the above is optional
18+
\s* [}\])] # optionally followed by whitespace, followed by a closing: curly brace, square bracket or paren
1619
| # OR
1720
\s* (<\?(php)?\s+)? # an optional PHP open tag
1821
(else(if)?\b.*:\s*($|//|/\*)|(end(if|for(each)?|switch|while))\b) # followed by an keyword that ends a control flow block

0 commit comments

Comments
 (0)