From 099992ecae5ed51332f3928b9e1c06e7ad8147b8 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 72bcdd5ec4..bfe6242a64 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");