Skip to content

Commit

Permalink
Added "indent spaces" setting. Closes stylus#445
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Oct 24, 2011
1 parent 0de8a59 commit 2b12f7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/visitor/compiler.js
Expand Up @@ -31,6 +31,7 @@ var Compiler = module.exports = function Compiler(root, options) {
this.compress = options.compress;
this.firebug = options.firebug;
this.linenos = options.linenos;
this.spaces = options['indent spaces'] || 2;
this.indents = 1;
Visitor.call(this, root);
this.tree = [];
Expand Down Expand Up @@ -62,9 +63,8 @@ Compiler.prototype.compile = function(){
*/

Compiler.prototype.__defineGetter__('indent', function(){
return this.compress
? ''
: new Array(this.indents).join(' ');
if (this.compress) return '';
return new Array(this.indents).join(Array(this.spaces + 1).join(' '));
});

/**
Expand Down

0 comments on commit 2b12f7e

Please sign in to comment.