         cursor = editor.cursors[0]
         text = editor.getSelections()[0].getText()
 
+        @tabString = "\t";
+        tabLength = atom.config.get("editor.tabLength")
+        if atom.config.get("editor.tabType") == "soft" or atom.config.get("editor.tabType") == "auto"
+            @tabString = ""
+            i = 0
+            while i < 4
+                i++
+                @tabString += " "
+
+
         # Parse classdef to find out what needs to be generated
         classdef = module.exports.parseClassdef(text)
 


                if param.type
                    checks = true
                    buffer += "\tif (typeof #{param.name} !== \"#{param.type}\") throw new Error(\"Parameter '#{param.name}' expects to be type '#{param.type}'\");\n"
                if param.instance
                    checks = true
                    buffer += "\tif (!(#{param.name} instanceof #{param.instance})) throw new Error(\"Parameter '#{param.name}' expects to be instance of '#{param.instance}'\");\n"


        if parameters.length > 0 && members

                    buffer += module.exports.indent(module.exports.generateMethod(classdef.name, method.name, method.parameters, method.type), 1)

            buffer += "\n"
            buffer += "#{@tabString}return #{classdef.name};"
            buffer += "\n}());"

        else if classdef.type == "require"
