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