Attempting to unify the style of the various snippets. The idea is that if it's fewer characters to add something than to remove it, then it gets removed from the snippet.

git-svn-id: http://macromates.com/svn/Bundles/trunk/Review/Bundles/JavaScript.tmbundle@10173 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
This commit is contained in:
subtlegradient
2008-07-05 23:42:37 +00:00
committed by Thomas Aylott
parent ec99bb4c5c
commit 9befbaa4c5
4 changed files with 9 additions and 30 deletions
+2 -4
View File
@@ -1,14 +1,12 @@
<?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">
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>cat &lt;&lt;SNIPPET
function ${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}(\${1:args}) {
\$0
}
function ${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}(\$1){\$0};
SNIPPET</string>
<key>fallbackInput</key>
<string>word</string>
+4 -5
View File
@@ -1,15 +1,14 @@
<?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">
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>cat &lt;&lt;SNIPPET
${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}: function(\${1:args}) {
\$0
}\${2:,}
SNIPPET</string>
${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}: function(\$1){\$0},
SNIPPET
</string>
<key>fallbackInput</key>
<string>word</string>
<key>input</key>
-18
View File
@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>function ${1:function_name}(${2:argument}) {
${0:// body...}
}</string>
<key>name</key>
<string>Function</string>
<key>scope</key>
<string>source.js</string>
<key>tabTrigger</key>
<string>fun</string>
<key>uuid</key>
<string>F0E4FB6A-4878-48C6-A777-62438DF1E14F</string>
</dict>
</plist>
+3 -3
View File
@@ -3,14 +3,14 @@
<plist version="1.0">
<dict>
<key>content</key>
<string>function($1){${0:${TM_SELECTED_TEXT}}}</string>
<string>function$1($2){$0}</string>
<key>name</key>
<string>Anonymous Function</string>
<string>Function</string>
<key>scope</key>
<string>source.js</string>
<key>tabTrigger</key>
<string>f</string>
<key>uuid</key>
<string>4C6EDB43-3E2E-411B-A016-13C135C59833</string>
<string>F0E4FB6A-4878-48C6-A777-62438DF1E14F</string>
</dict>
</plist>