-
-
Notifications
You must be signed in to change notification settings - Fork 298
/
Indentation Rules.tmPreferences
54 lines (54 loc) · 1.85 KB
/
Indentation Rules.tmPreferences
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Indentation Rules</string>
<key>scope</key>
<string>source.go</string>
<key>settings</key>
<dict>
<key>decreaseIndentPattern</key>
<string><![CDATA[(?x)
^ # start of line
(.*\*/)? # skip comments if present
( # three possibilities
\s* \} # whitespace and a closing curly brace
( # capture:
[^}{"']* \{ # anything other than curly braces or quotes, then open curly
)? # (optional)
[;\s]*? # any whitespace or semicolons
|
(?:\s* (case|default).*:) # case statements pop back one indent
|
(?: \) (?<! \( ) ) # closing braces not preceded by opening braces
)
(//.*|/\*.*\*/\s*)? # skip any comments (optional)
$ # end of line
]]></string>
<key>increaseIndentPattern</key>
<string>(?x)
^
(?: .* \*/ )? # skip any comments
(?:
(.* \{ [^}"'\n]*) # lines containing an open curly but no quotes or close curly
| # OR
(?:\s* (case|default).*:) # case statements
| # OR
(.* \( [^)"'\n]*) # lines containing an open brace but no quotes or close brace
)
(//.*|/\*.*\*/\s*)? # skip any comments (optional)
$
</string>
<!--
<key>indentNextLinePattern</key>
<string>(?x)^
(?! .* [;:{}] # do not indent when line ends with ;, :, {, or }
\s* (//|/[*] .* [*]/ \s* $) # …account for potential trailing comment
)
</string>
-->
<key>unIndentedLinePattern</key>
<string>^\s*((/\*|\*/|//|import\b.*|package\b.*).*)?$</string>
</dict>
</dict>
</plist>