From 92d94e89b186ce643237e3ee3dbac3d8d80f0320 Mon Sep 17 00:00:00 2001 From: Ryan Bright Date: Sun, 18 Mar 2012 19:44:33 -0400 Subject: [PATCH] Changed the CoffeeScript snippet to use the filename as the default class name. --- snippets/coffee.snippets | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/snippets/coffee.snippets b/snippets/coffee.snippets index d7a30f2..dfe3658 100644 --- a/snippets/coffee.snippets +++ b/snippets/coffee.snippets @@ -30,20 +30,22 @@ snippet bfun ${2:// body...} # Class snippet cla class .. - class ${1:ClassName} - ${2:// body...} + class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} + ${2} snippet cla class .. constructor: .. - class ${1:ClassName} + class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} constructor: (${2:args}) -> - ${3:// body...} + ${3} + ${4} snippet cla class .. extends .. - class ${1:ClassName} extends ${2:Ancestor} - ${3:// body...} + class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass} + ${3} snippet cla class .. extends .. constructor: .. - class ${1:ClassName} extends ${2:Ancestor} + class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass} constructor: (${3:args}) -> - ${4:// body...} + ${4} + ${5} # If snippet if