lib/scss_beautifier/convert.rb in scss_beautifier-0.1.18 vs lib/scss_beautifier/convert.rb in scss_beautifier-0.1.19

- old
+ new

@@ -1,14 +1,15 @@ class SCSSBeautifier::Convert < Sass::Tree::Visitors::Convert def visit_if(node, &block) - if true + if @options[:else_placement] == "same_line" visit_if_no_newline(node, &block) else super(node) end end - # ElsePlacement + + # ElsePlacement on same_line def visit_if_no_newline(node) name = if !@is_else "if" elsif node.expr @@ -63,10 +64,10 @@ end.join.rstrip + "\n" end def visit_comment(node) value = super - node.scss_beautifier_options[:inline] ? ' ' + value.lstrip! : value + node.scss_beautifier_options[:inline] ? ' ' + value.lstrip.to_s : value end def inline_comment?(node, comment_node) comment_node.is_a?(Sass::Tree::CommentNode) && node.line == comment_node.line end