-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from deathaxe/pr/st4152-rewrite
Rewrite for ST4152+
- Loading branch information
Showing
31 changed files
with
1,316 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"caption": "Preferences: Mustache Key Bindings", | ||
"command": "edit_settings", | ||
"args": { | ||
"base_file": "${packages}/Mustache/Default.sublime-keymap", | ||
"default": "[\n\t${0}\n]\n" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
[ | ||
// Expand {|} to {{ | }} when { is pressed | ||
{ | ||
"keys": [" "], | ||
"command": "insert_snippet", | ||
"args": { "contents": " ${0} " }, | ||
"context": [ | ||
{ "key": "selector", "operand": "meta.template.mustache" }, | ||
{ "key": "setting.auto_match_enabled", "operand": true }, | ||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "{{[!$#^/$>]?$", "match_all": true }, | ||
{ "key": "following_text", "operator": "regex_contains", "operand": "}}$", "match_all": true } | ||
] | ||
}, | ||
// Reduce {{|}} to | when backspace is pressed | ||
{ | ||
"keys": ["backspace"], | ||
"command": "chain", | ||
"args": { | ||
"commands": [ | ||
{"command": "left_delete" }, | ||
{"command": "right_delete" }, | ||
{"command": "left_delete" }, | ||
{"command": "right_delete" } | ||
] | ||
}, | ||
"context": [ | ||
{ "key": "selector", "operand": "meta.template.mustache meta.embedded" }, | ||
{ "key": "setting.auto_match_enabled", "operand": true }, | ||
{ "key": "selection_empty", "operand": true, "match_all": true }, | ||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "{{$", "match_all": true }, | ||
{ "key": "following_text", "operator": "regex_contains", "operand": "^}}", "match_all": true } | ||
] | ||
}, | ||
// Reduce {{! | }} to {{!|}} or {{ | }} to {{|}} when backspace is pressed | ||
{ | ||
"keys": ["backspace"], | ||
"command": "chain", | ||
"args": { | ||
"commands": [ | ||
{"command": "left_delete" }, | ||
{"command": "right_delete" } | ||
] | ||
}, | ||
"context": [ | ||
{ "key": "selector", "operand": "meta.template.mustache meta.embedded" }, | ||
{ "key": "setting.auto_match_enabled", "operand": true }, | ||
{ "key": "selection_empty", "operand": true, "match_all": true }, | ||
{ "key": "preceding_text", "operator": "regex_contains", "operand": "{{[!$#^/&>]? $", "match_all": true }, | ||
{ "key": "following_text", "operator": "regex_contains", "operand": "^ }}", "match_all": true } | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}! ${0:comment} ${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>!</tabTrigger> | ||
<scope>meta.template.mustache</scope> | ||
<description>Mustache Comment</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<snippet> | ||
<content><![CDATA[ | ||
${TM_TEMPLATE_START}^ ${1:variable} ${TM_TEMPLATE_END} | ||
${TM_TEMPLATE_INDENT}$0 | ||
${TM_TEMPLATE_START}/ ${1:variable} ${TM_TEMPLATE_END} | ||
]]></content> | ||
<tabTrigger>else</tabTrigger> | ||
<scope>meta.template.mustache</scope> | ||
<description>Mustache Inverted Section</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<snippet> | ||
<content><![CDATA[ | ||
${TM_TEMPLATE_START}# ${1:variable} ${TM_TEMPLATE_END} | ||
${TM_TEMPLATE_INDENT}$0 | ||
${TM_TEMPLATE_START}/ ${1:variable} ${TM_TEMPLATE_END} | ||
]]></content> | ||
<tabTrigger>if</tabTrigger> | ||
<scope>meta.template.mustache</scope> | ||
<description>Mustache Section</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START}> ${1:partial} ${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>inc</tabTrigger> | ||
<scope>meta.template.mustache</scope> | ||
<description>Mustache Partial</description> | ||
</snippet> |
6 changes: 2 additions & 4 deletions
6
snippets/safe-variable.sublime-snippet → Snippets/safe-variable.sublime-snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[ | ||
{{{ ${1:variable} }}} | ||
]]></content> | ||
<content><![CDATA[{{{ ${1:variable} }}}]]></content> | ||
<tabTrigger>let</tabTrigger> | ||
<scope>meta.template.mustache</scope> | ||
<description>Mustache Unescaped Variable</description> | ||
<scope>embedding.mustache</scope> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[${TM_TEMPLATE_START} ${1:variable} ${TM_TEMPLATE_END}]]></content> | ||
<tabTrigger>var</tabTrigger> | ||
<scope>meta.template.mustache</scope> | ||
<description>Mustache Escaped Variable</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
%YAML 1.2 | ||
--- | ||
# http://www.sublimetext.com/docs/syntax.html | ||
name: CSS (Mustache) | ||
scope: source.css.mustache | ||
version: 2 | ||
|
||
extends: Packages/CSS/CSS.sublime-syntax | ||
|
||
file_extensions: | ||
- css.mustache | ||
- mustache.css | ||
|
||
variables: | ||
|
||
# CSS overrides | ||
|
||
ident_start: (?:{{nmstart}}|{{mustache_tag_start}}) | ||
|
||
# required until ST4173 | ||
selector_begin: (?={{selector_start}}|{{mustache_tag_start}}) | ||
# required until ST4173 | ||
nested_selector_begin: (?={{nested_selector_start}}|{{mustache_tag_start}}) | ||
|
||
tag_name_begin: (?=[[:alpha:]]|{{mustache_tag_start}}) | ||
|
||
# CSS (Mustache) variables | ||
|
||
mustache_tag_start: '{{' | ||
mustache_tag_end: '}}' | ||
|
||
contexts: | ||
main: | ||
- meta_prepend: true | ||
- meta_scope: meta.template.mustage | ||
|
||
prototype: | ||
- meta_prepend: true | ||
- include: Text (Mustache).sublime-syntax | ||
|
||
string-content: | ||
- meta_prepend: true | ||
- include: Text (Mustache).sublime-syntax#interpolations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>scope</key> | ||
<string> | ||
source.css.mustache, | ||
text.html.mustache source.css.embedded | ||
</string> | ||
<key>settings</key> | ||
<dict> | ||
<key>shellVariables</key> | ||
<array> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_START</string> | ||
<key>value</key> | ||
<string>{{! </string> | ||
</dict> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_END</string> | ||
<key>value</key> | ||
<string> }}</string> | ||
</dict> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_START_2</string> | ||
<key>value</key> | ||
<string>/* </string> | ||
</dict> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_END_2</string> | ||
<key>value</key> | ||
<string> */</string> | ||
</dict> | ||
</array> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>scope</key> | ||
<string> | ||
source.css.mustache, | ||
text.html.mustache source.css.embedded | ||
</string> | ||
<key>settings</key> | ||
<dict> | ||
<key>shellVariables</key> | ||
<array> | ||
<dict> | ||
<!-- Syntax specific block snippet content indentation --> | ||
<key>name</key> | ||
<string>TM_TEMPLATE_INDENT</string> | ||
<key>value</key> | ||
<string></string> | ||
</dict> | ||
</array> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>scope</key> | ||
<string>text.html.mustache</string> | ||
<key>settings</key> | ||
<dict> | ||
<key>shellVariables</key> | ||
<array> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_START</string> | ||
<key>value</key> | ||
<string>{{! </string> | ||
</dict> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_END</string> | ||
<key>value</key> | ||
<string> }}</string> | ||
</dict> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_START_2</string> | ||
<key>value</key> | ||
<string><![CDATA[<!-- ]]></string> | ||
</dict> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_END_2</string> | ||
<key>value</key> | ||
<string><![CDATA[ -->]]></string> | ||
</dict> | ||
</array> | ||
</dict> | ||
</dict> | ||
</plist> |
Oops, something went wrong.