From 98b1de919909827dc9cd22edf2e99f828950c0cd Mon Sep 17 00:00:00 2001 From: Christopher Joslyn Date: Wed, 3 Aug 2011 08:56:12 -0400 Subject: [PATCH] Reformatted leading whitespace to conform with the implied format. --- snippets/javascript.snippets | 73 ++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/snippets/javascript.snippets b/snippets/javascript.snippets index 0f81901..a735f60 100644 --- a/snippets/javascript.snippets +++ b/snippets/javascript.snippets @@ -96,62 +96,61 @@ snippet cl console.log(${1}); # return snippet ret - return ${1:result} + return ${1:result} # for (property in object ) { ... } snippet fori - for (var ${1:prop} in ${2:Things}) { - ${3:$2[$1]} - }; + for (var ${1:prop} in ${2:Things}) { + ${3:$2[$1]} + }; # hasOwnProperty snippet has - hasOwnProperty(${1}) + hasOwnProperty(${1}) # docstring snippet /** - /** - * ${1:description} - * - */ + /** + * ${1:description} + * + */ snippet @par - @param {${1:type}} ${2:name} ${3:description} + @param {${1:type}} ${2:name} ${3:description} snippet @ret - @return {${1:type}} ${2:description} - + @return {${1:type}} ${2:description} # JSON.parse snippet jsonp - JSON.parse(${1:jstr}); + JSON.parse(${1:jstr}); # JSON.stringify snippet jsons - JSON.stringify(${1:object}); + JSON.stringify(${1:object}); # self-defining function snippet sdf - var ${1:function_name} = function (${2:argument}) { - ${3:// initial code ...} + var ${1:function_name} = function (${2:argument}) { + ${3:// initial code ...} - $1 = function ($2) { - ${4:// main code} - }; - } + $1 = function ($2) { + ${4:// main code} + }; + } # singleton snippet sing - function ${1:Singleton} (${2:argument}) { - // the cached instance - var instance; + function ${1:Singleton} (${2:argument}) { + // the cached instance + var instance; - // rewrite the constructor - $1 = function $1($2) { - return instance; - }; - - // carry over the prototype properties - $1.prototype = this; + // rewrite the constructor + $1 = function $1($2) { + return instance; + }; + + // carry over the prototype properties + $1.prototype = this; - // the instance - instance = new $1(); + // the instance + instance = new $1(); - // reset the constructor pointer - instance.constructor = $1; + // reset the constructor pointer + instance.constructor = $1; - ${3:// code ...} + ${3:// code ...} - return instance; - } \ No newline at end of file + return instance; + }