From 43247731b7d8ac89240dfcd3557e7069d3ccc9f8 Mon Sep 17 00:00:00 2001 From: ujihisa Date: Thu, 25 Oct 2012 09:00:07 -0700 Subject: [PATCH] javascript snippet bugfix: follows changes in prev_word/options --- autoload/neosnippet/snippets/javascript.snip | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/autoload/neosnippet/snippets/javascript.snip b/autoload/neosnippet/snippets/javascript.snip index 46216ca..1857d6f 100644 --- a/autoload/neosnippet/snippets/javascript.snip +++ b/autoload/neosnippet/snippets/javascript.snip @@ -5,36 +5,43 @@ snippet :f snippet func alias function +options word function ${1:function_name}(${2:argument}) { ${0:// body...} } snippet proto +options head ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) { ${0:// body...} }; snippet f +options word function(${1}) { ${0:$TM_SELECTED_TEXT} }; snippet if +options head if (${1:true}) { ${0:$TM_SELECTED_TEXT} } snippet ife +options head if (${1:true}) { ${0:$TM_SELECTED_TEXT} } else { } snippet for +options head for (var ${2:i}=0; $2 < ${1:Things}.length; $2++) { ${0} } snippet forin +options head for (var ${2:i} in ${1:Things}) { ${0} }; @@ -46,4 +53,5 @@ snippet key ${1:key}: "${2:value}"}${3:, } snippet timeout +options head setTimeout(function() {${0}}${2:}, ${1:10});