From c8be8250a499b5309547785a390978c5331ed433 Mon Sep 17 00:00:00 2001 From: Anthony Van de Gejuchte Date: Fri, 9 Jan 2015 16:46:40 +0100 Subject: [PATCH] Keep single line comments after nlb, after nlb Fixes #583 --- lib/output.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/output.js b/lib/output.js index 72bcdd5e..bfe6242a 100644 --- a/lib/output.js +++ b/lib/output.js @@ -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");