From 9befbaa4c537c6f83a47d38409cc5de17c873c4a Mon Sep 17 00:00:00 2001 From: subtlegradient Date: Sat, 5 Jul 2008 23:42:37 +0000 Subject: [PATCH] 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 --- Commands/New Function.tmCommand | 6 ++---- Commands/New Method.tmCommand | 9 ++++----- Snippets/function (fun).plist | 18 ------------------ Snippets/function.tmSnippet | 6 +++--- 4 files changed, 9 insertions(+), 30 deletions(-) delete mode 100644 Snippets/function (fun).plist diff --git a/Commands/New Function.tmCommand b/Commands/New Function.tmCommand index 064d364..df612f6 100644 --- a/Commands/New Function.tmCommand +++ b/Commands/New Function.tmCommand @@ -1,14 +1,12 @@ - + beforeRunningCommand nop command cat <<SNIPPET -function ${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}(\${1:args}) { - \$0 -} +function ${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}(\$1){\$0}; SNIPPET fallbackInput word diff --git a/Commands/New Method.tmCommand b/Commands/New Method.tmCommand index 2e02018..6d48573 100644 --- a/Commands/New Method.tmCommand +++ b/Commands/New Method.tmCommand @@ -1,15 +1,14 @@ - + beforeRunningCommand nop command cat <<SNIPPET -${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}: function(\${1:args}) { - \$0 -}\${2:,} -SNIPPET +${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}: function(\$1){\$0}, +SNIPPET + fallbackInput word input diff --git a/Snippets/function (fun).plist b/Snippets/function (fun).plist deleted file mode 100644 index f8a5177..0000000 --- a/Snippets/function (fun).plist +++ /dev/null @@ -1,18 +0,0 @@ - - - - - content - function ${1:function_name}(${2:argument}) { - ${0:// body...} -} - name - Function - scope - source.js - tabTrigger - fun - uuid - F0E4FB6A-4878-48C6-A777-62438DF1E14F - - diff --git a/Snippets/function.tmSnippet b/Snippets/function.tmSnippet index f95fea1..b90dba6 100644 --- a/Snippets/function.tmSnippet +++ b/Snippets/function.tmSnippet @@ -3,14 +3,14 @@ content - function($1){${0:${TM_SELECTED_TEXT}}} + function$1($2){$0} name - Anonymous Function + Function scope source.js tabTrigger f uuid - 4C6EDB43-3E2E-411B-A016-13C135C59833 + F0E4FB6A-4878-48C6-A777-62438DF1E14F