Skip to content

Commit

Permalink
Keep single line comments after nlb, after nlb
Browse files Browse the repository at this point in the history
Fixes #583
  • Loading branch information
avdg authored and rvanvelzen committed Jan 26, 2015
1 parent d78ae20 commit 099992e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/output.js
Expand Up @@ -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");
Expand Down

0 comments on commit 099992e

Please sign in to comment.