Keep single line comments after nlb, after nlb

Fixes #583
This commit is contained in:
Anthony Van de Gejuchte
2015-01-09 16:46:40 +01:00
committed by Richard van Velzen
parent d78ae20e64
commit 099992ecae

View File

@@ -413,6 +413,15 @@ function OutputStream(options) {
return c(self, comment);
});
}
// Keep single line comments after nlb, after nlb
if (!output.option("beautify") && comments.length > 0 &&
/comment[134]/.test(comments[0].type) &&
output.col() !== 0 && comments[0].nlb)
{
output.print("\n");
}
comments.forEach(function(c){
if (/comment[134]/.test(c.type)) {
output.print("//" + c.value + "\n");