Skip to content

Commit

Permalink
Fixed conditional import
Browse files Browse the repository at this point in the history
See #20
  • Loading branch information
ThisIsManta committed Jan 20, 2018
1 parent d24b47c commit 4972389
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 5 additions & 3 deletions edge/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ function format(content, options = {}) {
outputBuffer.append(' ')
outputBuffer.append(travel(inputNode, inputNode.path, indentLevel, true))

if (options.insertSemicolons) {
outputBuffer.append(';')
if (insideExpression === false) {
if (options.insertSemicolons) {
outputBuffer.append(';')
}
outputBuffer.append(options.newLineChar)
}
outputBuffer.append(options.newLineChar)

} else if (inputNode instanceof Stylus.nodes.Group) {
// Insert single-line comment(s)
Expand Down
4 changes: 3 additions & 1 deletion spec/condition/input.styl
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ body
negative(n)
error('invalid number') unless n is a 'unit'
return yes if n < 0
no
no

@import -fn if (exists(-fn));
4 changes: 3 additions & 1 deletion spec/condition/output.styl
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ negative(n) {
return yes if (n < 0);

no;
}
}

@import -fn if (exists(-fn));

0 comments on commit 4972389

Please sign in to comment.