|
3 | 3 | // <% %> |
4 | 4 | { "keys": ["%"], "command": "insert_snippet", "args": {"contents": "%${0: }%>"}, "context": |
5 | 5 | [ |
6 | | - { "key": "selector", "operand": "text.ejs.percentsign - source.js", "match_all": true }, |
| 6 | + { "key": "selector", "operand": "text.html.ejs - text.html.ejs source.js", "match_all": true }, |
7 | 7 | { "key": "setting.auto_match_enabled", "operand": true }, |
8 | 8 | { "key": "selection_empty", "operand": true, "match_all": true }, |
9 | 9 | { "key": "preceding_text", "operator": "regex_contains", "operand": "<$", "match_all": true }, |
|
13 | 13 | // <? ?> |
14 | 14 | { "keys": ["?"], "command": "insert_snippet", "args": {"contents": "?${0: }?>"}, "context": |
15 | 15 | [ |
16 | | - { "key": "selector", "operand": "text.ejs.questionmark - source.js", "match_all": true }, |
| 16 | + { "key": "selector", "operand": "text.html.ejs.questionmark - text.html.ejs source.js", "match_all": true }, |
17 | 17 | { "key": "setting.auto_match_enabled", "operand": true }, |
18 | 18 | { "key": "selection_empty", "operand": true, "match_all": true }, |
19 | 19 | { "key": "preceding_text", "operator": "regex_contains", "operand": "<$", "match_all": true }, |
20 | | - { "key": "following_text", "operator": "not_regex_contains", "operand": "^[?=_#>-]", "match_all": true } |
21 | | - ] |
22 | | - }, |
23 | | - // <$ $> |
24 | | - { "keys": ["$"], "command": "insert_snippet", "args": {"contents": "\\$${0: }\\$>"}, "context": |
25 | | - [ |
26 | | - { "key": "selector", "operand": "text.ejs.dollarsign - source.js", "match_all": true }, |
27 | | - { "key": "setting.auto_match_enabled", "operand": true }, |
28 | | - { "key": "selection_empty", "operand": true, "match_all": true }, |
29 | | - { "key": "preceding_text", "operator": "regex_contains", "operand": "<$", "match_all": true }, |
30 | | - { "key": "following_text", "operator": "not_regex_contains", "operand": "^[$=_#>-]", "match_all": true } |
31 | | - ] |
32 | | - }, |
33 | | - // <@ @> |
34 | | - { "keys": ["@"], "command": "insert_snippet", "args": {"contents": "@${0: }@>"}, "context": |
35 | | - [ |
36 | | - { "key": "selector", "operand": "text.ejs.atsign - source.js", "match_all": true }, |
37 | | - { "key": "setting.auto_match_enabled", "operand": true }, |
38 | | - { "key": "selection_empty", "operand": true, "match_all": true }, |
39 | | - { "key": "preceding_text", "operator": "regex_contains", "operand": "<$", "match_all": true }, |
40 | | - { "key": "following_text", "operator": "not_regex_contains", "operand": "^[@=_#>-]", "match_all": true } |
| 20 | + { "key": "following_text", "operator": "not_regex_contains", "operand": "^[%=_#>-]", "match_all": true } |
41 | 21 | ] |
42 | 22 | }, |
| 23 | + |
43 | 24 | // Auto-indent |
44 | 25 | // <% %> |
45 | 26 | { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n\t$0\n"}, "context": |
46 | 27 | [ |
47 | | - { "key": "selector", "operand": "text.ejs.percentsign - source.js", "match_all": true }, |
| 28 | + { "key": "selector", "operand": "text.html.ejs", "match_all": true }, |
48 | 29 | { "key": "setting.auto_indent", "operand": true }, |
49 | 30 | { "key": "selection_empty", "operand": true, "match_all": true }, |
50 | | - { "key": "preceding_text", "operator": "regex_contains", "operand": "<%(?!%)[=_#-]?\\s*$", "match_all": true }, |
51 | | - { "key": "following_text", "operator": "regex_contains", "operand": "^[_-]?%>", "match_all": true } |
52 | | - ] |
53 | | - }, |
54 | | - { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n\t$0\n"}, "context": |
55 | | - [ |
56 | | - { "key": "selector", "operand": "text.ejs.percentsign punctuation.definition.js.end.ejs", "match_all": true }, |
57 | | - { "key": "setting.auto_indent", "operand": true }, |
58 | | - { "key": "selection_empty", "operand": false, "match_all": true }, |
59 | | - { "key": "preceding_text", "operator": "regex_contains", "operand": "<%(?!%)[=_#-]?\\s*$", "match_all": true }, |
| 31 | + { "key": "preceding_text", "operator": "regex_contains", "operand": "<%[#=_-]?\\s*$", "match_all": true }, |
60 | 32 | { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*[_-]?%>", "match_all": true } |
61 | 33 | ] |
62 | 34 | }, |
63 | 35 | // <? ?> |
64 | 36 | { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n\t$0\n"}, "context": |
65 | 37 | [ |
66 | | - { "key": "selector", "operand": "text.ejs.questionmark - source.js", "match_all": true }, |
| 38 | + { "key": "selector", "operand": "text.html.ejs.questionmark", "match_all": true }, |
67 | 39 | { "key": "setting.auto_indent", "operand": true }, |
68 | 40 | { "key": "selection_empty", "operand": true, "match_all": true }, |
69 | | - { "key": "preceding_text", "operator": "regex_contains", "operand": "<\\?(?!\\?)[=_#-]?\\s*$", "match_all": true }, |
70 | | - { "key": "following_text", "operator": "regex_contains", "operand": "^[_-]?\\?>", "match_all": true } |
71 | | - ] |
72 | | - }, |
73 | | - { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n\t$0\n"}, "context": |
74 | | - [ |
75 | | - { "key": "selector", "operand": "text.ejs.questionmark punctuation.definition.js.end.ejs", "match_all": true }, |
76 | | - { "key": "setting.auto_indent", "operand": true }, |
77 | | - { "key": "selection_empty", "operand": false, "match_all": true }, |
78 | | - { "key": "preceding_text", "operator": "regex_contains", "operand": "<\\?(?!\\?)[=_#-]?\\s*$", "match_all": true }, |
| 41 | + { "key": "preceding_text", "operator": "regex_contains", "operand": "<\\?[#=_-]?\\s*$", "match_all": true }, |
79 | 42 | { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*[_-]?\\?>", "match_all": true } |
80 | 43 | ] |
81 | 44 | }, |
82 | | - // <$ $> |
83 | | - { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n\t$0\n"}, "context": |
84 | | - [ |
85 | | - { "key": "selector", "operand": "text.ejs.dollarsign - source.js", "match_all": true }, |
86 | | - { "key": "setting.auto_indent", "operand": true }, |
87 | | - { "key": "selection_empty", "operand": true, "match_all": true }, |
88 | | - { "key": "preceding_text", "operator": "regex_contains", "operand": "<\\$(?!\\$)[=_#-]?\\s*$", "match_all": true }, |
89 | | - { "key": "following_text", "operator": "regex_contains", "operand": "^[_-]?\\$>", "match_all": true } |
90 | | - ] |
91 | | - }, |
92 | | - { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n\t$0\n"}, "context": |
93 | | - [ |
94 | | - { "key": "selector", "operand": "text.ejs.dollarsign punctuation.definition.js.end.ejs", "match_all": true }, |
95 | | - { "key": "setting.auto_indent", "operand": true }, |
96 | | - { "key": "selection_empty", "operand": false, "match_all": true }, |
97 | | - { "key": "preceding_text", "operator": "regex_contains", "operand": "<\\$(?!\\$)[=_#-]?\\s*$", "match_all": true }, |
98 | | - { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*[_-]?\\$>", "match_all": true } |
99 | | - ] |
100 | | - }, |
101 | | - // <@ @> |
102 | | - { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n\t$0\n"}, "context": |
103 | | - [ |
104 | | - { "key": "selector", "operand": "text.ejs.atsign - source.js", "match_all": true }, |
105 | | - { "key": "setting.auto_indent", "operand": true }, |
106 | | - { "key": "selection_empty", "operand": true, "match_all": true }, |
107 | | - { "key": "preceding_text", "operator": "regex_contains", "operand": "<@(?!@)[=_#-]?\\s*$", "match_all": true }, |
108 | | - { "key": "following_text", "operator": "regex_contains", "operand": "^[_-]?@>", "match_all": true } |
109 | | - ] |
110 | | - }, |
111 | | - { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n\t$0\n"}, "context": |
112 | | - [ |
113 | | - { "key": "selector", "operand": "text.ejs.atsign punctuation.definition.js.end.ejs", "match_all": true }, |
114 | | - { "key": "setting.auto_indent", "operand": true }, |
115 | | - { "key": "selection_empty", "operand": false, "match_all": true }, |
116 | | - { "key": "preceding_text", "operator": "regex_contains", "operand": "<@(?!@)[=_#-]?\\s*$", "match_all": true }, |
117 | | - { "key": "following_text", "operator": "regex_contains", "operand": "^\\s*[_-]?@>", "match_all": true } |
118 | | - ] |
119 | | - } |
120 | 45 | ] |
0 commit comments