javascript snippet bugfix: follows changes in prev_word/options

This commit is contained in:
ujihisa 2012-10-25 09:00:07 -07:00
parent f46f36837e
commit 43247731b7

View File

@ -5,36 +5,43 @@ snippet :f
snippet func snippet func
alias function alias function
options word
function ${1:function_name}(${2:argument}) { function ${1:function_name}(${2:argument}) {
${0:// body...} ${0:// body...}
} }
snippet proto snippet proto
options head
${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) { ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {
${0:// body...} ${0:// body...}
}; };
snippet f snippet f
options word
function(${1}) { ${0:$TM_SELECTED_TEXT} }; function(${1}) { ${0:$TM_SELECTED_TEXT} };
snippet if snippet if
options head
if (${1:true}) { if (${1:true}) {
${0:$TM_SELECTED_TEXT} ${0:$TM_SELECTED_TEXT}
} }
snippet ife snippet ife
options head
if (${1:true}) { if (${1:true}) {
${0:$TM_SELECTED_TEXT} ${0:$TM_SELECTED_TEXT}
} else { } else {
} }
snippet for snippet for
options head
for (var ${2:i}=0; $2 < ${1:Things}.length; $2++) { for (var ${2:i}=0; $2 < ${1:Things}.length; $2++) {
${0} ${0}
} }
snippet forin snippet forin
options head
for (var ${2:i} in ${1:Things}) { for (var ${2:i} in ${1:Things}) {
${0} ${0}
}; };
@ -46,4 +53,5 @@ snippet key
${1:key}: "${2:value}"}${3:, } ${1:key}: "${2:value}"}${3:, }
snippet timeout snippet timeout
options head
setTimeout(function() {${0}}${2:}, ${1:10}); setTimeout(function() {${0}}${2:}, ${1:10});