add minimum of 1 newline after line comments - fixes #442 and fixes #477

This commit is contained in:
Sebastian McKenzie
2015-01-13 23:27:52 +11:00
parent 4898770d60
commit f25ed0b5de

View File

@@ -47,7 +47,13 @@ Whitespace.prototype.getNewlinesAfter = function (node) {
if (endToken.type.type === "eof") {
return 1;
} else {
return this.getNewlinesBetween(startToken, endToken);
var lines = this.getNewlinesBetween(startToken, endToken);
if (node.type === "Line" && !lines) {
// line comment
return 1;
} else {
return lines;
}
}
};