forked from sublimehq/Packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIndentation.tmPreferences
45 lines (45 loc) · 2.11 KB
/
Indentation.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
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Indentation Rules</string>
<key>scope</key>
<string>source.cs</string>
<key>settings</key>
<dict>
<key>decreaseIndentPattern</key>
<string>(?x)
^ # the beginning of the line
(.*\*/)? # optionally followed by the end of a block comment
\s* # followed by any amount of whitespace
\} # followed by a closing brace
( # followed by
[^}{"']* \{ # - anything thats not a brace or a string (or nothing), followed by an opening brace
| \s* while \s* \( .* # - or any whitespace followed by `while` followed by any whitespace followed by an opening paren
| , # - or a comma
)? # optional
[;\s]* # followed by any number of semi-colons or whitespace characters
(//.*|/\*.*\*/\s*)? # optionally followed by a comment
$ # the end of the line
</string>
<key>increaseIndentPattern</key>
<string>(?x)
^ # the beginning of the line
.* # followed by anything
\{ # followed by an open brace
[^}"']* # followed by any number of characters that isn't a close brace or a string
$ # the end of the line
</string>
<key>indentNextLinePattern</key>
<string>(?x)^
(?! .* [;:{}] # do not indent when line ends with ;, :, {, or }
\s* (//|/[*] .* [*]/ \s* $) # …account for potential trailing comment
)
.* [^\s;:{}] \s* $ # indent next if this one isn’t
# terminated with ;, :, {, or }
</string>
<key>unIndentedLinePattern</key>
<string>^\s*((/\*|\*/|//|#).*)?$</string>
</dict>
</dict>
</plist>