From 7c8a8d1c75d4486538bc3eb401e25f45e677b61b Mon Sep 17 00:00:00 2001 From: haraldmartin Date: Tue, 26 Sep 2006 15:20:02 +0000 Subject: [PATCH] =?UTF-8?q?=E2=80=A2=20=E2=87=A7=E2=86=A9=20(shift=20+=20e?= =?UTF-8?q?nter)=20will=20turn=20the=20current=20word=20as=20a=20function?= =?UTF-8?q?=20(like=20the=20ruby=20one=20does).=20=E2=87=A7=E2=8C=83?= =?UTF-8?q?=E2=86=A9=20(shift=20+=20control=20+=20enter)=20will=20make=20i?= =?UTF-8?q?t=20into=20a=20method=20instead=20(blah:=20function()=20{=20...?= =?UTF-8?q?=20})=20=E2=80=A2=20Cleaned=20up=20some=20snippets=20like=20set?= =?UTF-8?q?Timeout=20and=20the=20if/if=20else/function=20and=20others?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/JavaScript.tmbundle@5308 dfb7d73b-c2ec-0310-8fea-fb051d288c6d --- Commands/New Function.tmCommand | 28 +++++++++++++++++++ Commands/New Method.tmCommand | 28 +++++++++++++++++++ .../Object key — key: \"value\".tmSnippet" | 16 +++++++++++ Snippets/Prototype (proto).plist | 3 +- Snippets/function (fun).plist | 3 +- Snippets/function.tmSnippet | 2 +- Snippets/if ___ else.tmSnippet | 2 +- Snippets/if.tmSnippet | 2 +- Snippets/setTimeout function.tmSnippet | 2 +- info.plist | 10 +++++-- 10 files changed, 86 insertions(+), 10 deletions(-) create mode 100644 Commands/New Function.tmCommand create mode 100644 Commands/New Method.tmCommand create mode 100644 "Snippets/Object key — key: \"value\".tmSnippet" diff --git a/Commands/New Function.tmCommand b/Commands/New Function.tmCommand new file mode 100644 index 0000000..064d364 --- /dev/null +++ b/Commands/New Function.tmCommand @@ -0,0 +1,28 @@ + + + + + beforeRunningCommand + nop + command + cat <<SNIPPET +function ${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}(\${1:args}) { + \$0 +} +SNIPPET + fallbackInput + word + input + selection + keyEquivalent + $ + name + New Function + output + insertAsSnippet + scope + source.js + uuid + 73951799-AC15-40A6-81DB-EC051AB4A033 + + diff --git a/Commands/New Method.tmCommand b/Commands/New Method.tmCommand new file mode 100644 index 0000000..2e02018 --- /dev/null +++ b/Commands/New Method.tmCommand @@ -0,0 +1,28 @@ + + + + + beforeRunningCommand + nop + command + cat <<SNIPPET +${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}: function(\${1:args}) { + \$0 +}\${2:,} +SNIPPET + fallbackInput + word + input + selection + keyEquivalent + ~$ + name + New Method + output + insertAsSnippet + scope + source.js + uuid + 1717B5AE-209B-4548-9155-9E88A7230C1C + + diff --git "a/Snippets/Object key — key: \"value\".tmSnippet" "b/Snippets/Object key — key: \"value\".tmSnippet" new file mode 100644 index 0000000..d54893d --- /dev/null +++ "b/Snippets/Object key — key: \"value\".tmSnippet" @@ -0,0 +1,16 @@ + + + + + content + ${1:key}: ${2:"${3:value}"}${4:, } + name + Object key — key: "value" + scope + source.js + tabTrigger + : + uuid + DC8B46FB-8ADA-45EA-8F36-94C807A0D302 + + diff --git a/Snippets/Prototype (proto).plist b/Snippets/Prototype (proto).plist index d29abe2..252c279 100644 --- a/Snippets/Prototype (proto).plist +++ b/Snippets/Prototype (proto).plist @@ -3,8 +3,7 @@ content - ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) -{ + ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) { ${0:// body...} }; diff --git a/Snippets/function (fun).plist b/Snippets/function (fun).plist index e02e7c2..0ca6d4e 100644 --- a/Snippets/function (fun).plist +++ b/Snippets/function (fun).plist @@ -3,8 +3,7 @@ content - function ${1:function_name} (${2:first_argument}) -{ + function ${1:function_name} (${2:argument}) { ${0:// body...} } name diff --git a/Snippets/function.tmSnippet b/Snippets/function.tmSnippet index 49cb8db..2a8cf77 100644 --- a/Snippets/function.tmSnippet +++ b/Snippets/function.tmSnippet @@ -3,7 +3,7 @@ content - function($1){${0:$TM_SELECTED_TEXT}}; + function($1) {${0:$TM_SELECTED_TEXT}}; name function(){}; scope diff --git a/Snippets/if ___ else.tmSnippet b/Snippets/if ___ else.tmSnippet index 672f4aa..421f45e 100644 --- a/Snippets/if ___ else.tmSnippet +++ b/Snippets/if ___ else.tmSnippet @@ -3,7 +3,7 @@ content - if(${1:true}){${0:$TM_SELECTED_TEXT}}else{}; + if (${1:true}) {${0:$TM_SELECTED_TEXT}} else{}; name if … else scope diff --git a/Snippets/if.tmSnippet b/Snippets/if.tmSnippet index 452efe9..dbfb7e7 100644 --- a/Snippets/if.tmSnippet +++ b/Snippets/if.tmSnippet @@ -3,7 +3,7 @@ content - if(${1:true}){${0:$TM_SELECTED_TEXT}}; + if (${1:true}) {${0:$TM_SELECTED_TEXT}}; name if scope diff --git a/Snippets/setTimeout function.tmSnippet b/Snippets/setTimeout function.tmSnippet index 04ce12a..5d9894e 100644 --- a/Snippets/setTimeout function.tmSnippet +++ b/Snippets/setTimeout function.tmSnippet @@ -3,7 +3,7 @@ content - setTimeout((function() {$0})${2:}, ${1:10}); + setTimeout(function() {$0}${2:}, ${1:10}); name setTimeout function scope diff --git a/info.plist b/info.plist index dfd09f5..9397618 100644 --- a/info.plist +++ b/info.plist @@ -10,13 +10,16 @@ ------------------------------------ F0E4FB6A-4878-48C6-A777-62438DF1E14F 2F96136B-0193-42F5-90FC-B6F456A3AD77 + 4C6EDB43-3E2E-411B-A016-13C135C59833 + 73951799-AC15-40A6-81DB-EC051AB4A033 + 1717B5AE-209B-4548-9155-9E88A7230C1C ------------------------------------ F19F3732-39A7-48EC-A72B-A8F477A01795 31964029-9D71-4ADC-8213-DFE5C4E222B3 011C4681-FBEC-4891-9326-3DECFCDED6D6 - 4C6EDB43-3E2E-411B-A016-13C135C59833 ------------------------------------ 009A3E6C-FE3F-4A18-8759-2DC31F17BBE2 + DC8B46FB-8ADA-45EA-8F36-94C807A0D302 submenus @@ -28,13 +31,16 @@ B4874A14-2491-465A-A349-61E4EBCF4700 F0E4FB6A-4878-48C6-A777-62438DF1E14F 2F96136B-0193-42F5-90FC-B6F456A3AD77 + 73951799-AC15-40A6-81DB-EC051AB4A033 + 1717B5AE-209B-4548-9155-9E88A7230C1C + 4C6EDB43-3E2E-411B-A016-13C135C59833 93E017CC-6F27-11D9-90EB-000D93589AF6 BC062860-3346-4D3B-8421-C5543F83D11F F19F3732-39A7-48EC-A72B-A8F477A01795 31964029-9D71-4ADC-8213-DFE5C4E222B3 - 4C6EDB43-3E2E-411B-A016-13C135C59833 011C4681-FBEC-4891-9326-3DECFCDED6D6 009A3E6C-FE3F-4A18-8759-2DC31F17BBE2 + DC8B46FB-8ADA-45EA-8F36-94C807A0D302 uuid AAB4FD74-73F9-11D9-B89A-000D93589AF6