-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathecmascript-indent.YAML-tmPreferences
57 lines (54 loc) · 1.53 KB
/
ecmascript-indent.YAML-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
55
56
57
# [PackageDev] target_format: plist, ext: tmPreferences
name: Indent
uuid: 54754702-a030-4b65-af1b-45759e122b28
scope: source.es
settings:
increaseIndentPattern: >-
(?x)
^.* (
# braces
\{ (
# consume double-quoted string or single-quoted string
(?<string>"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')
# or any char that doesn't start string, comment or ending brace
| [^"'`/\}]
)*
# parens
| \( (
# consume double-quoted string or single-quoted string
\k<string>
# or any char that doesn't start string, comment or ending brace
| [^"'`/\)]
)*
# brackets
| \[ (
# consume double-quoted string or single-quoted string
\k<string>
# or any char that doesn't start string, comment or ending brace
| [^"'`/\]]
)*
)
# stop matching at EOL or comment
($|/[/*])
decreaseIndentPattern: >-
(?x)
(
^ (
# consume double-quoted string or single-quoted string
"(?:[^"\\]|\\.)*" | '(?:[^'\\]|\\.)*'
# or any char that doesn't start string, comment or opening indentation char on line
| [^"'`/\{\(\[\n]
)*
# followed by any one of the indentation chars
(
\} [^\{]* |
\) [^\(]* |
\] [^\[]*
)
)$
bracketIndentNextLinePattern: >-
(?x)
\b(
( do | else ) \s* |
( if | while | for ) \b .* \( .* \) [^;]*
)$