From 58e30d14591eb10410ecc9183ea23314dd3f8d6e Mon Sep 17 00:00:00 2001 From: harryxu Date: Fri, 25 Jan 2013 00:24:55 +0800 Subject: [PATCH] Improved 'if' and 'ife' snippets for js. --- UltiSnips/javascript.snippets | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/UltiSnips/javascript.snippets b/UltiSnips/javascript.snippets index e4e7f7a..11f3add 100644 --- a/UltiSnips/javascript.snippets +++ b/UltiSnips/javascript.snippets @@ -51,11 +51,18 @@ function ${1:function_name} (${2:argument}) { endsnippet snippet ife "if ___ else" -if (${1:true}) {$0} else{}; +if (${1:condition}) { + ${2://code} +} +else { + ${3://code} +} endsnippet snippet if "if" -if (${1:true}) {$0}; +if (${1:condition}) { + ${0://code} +} endsnippet snippet timeout "setTimeout function"