aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Van de Gejuchte <anthonyvdgent@yahoo.com>2015-01-09 16:46:40 +0100
committerRichard van Velzen <rvanvelzen1@gmail.com>2015-01-26 12:11:52 +0100
commit099992ecae5ed51332f3928b9e1c06e7ad8147b8 (patch)
tree37323c7053e5a463fb368b63c1d54dc412ab3fb7
parentd78ae20e64a6449b63ac86c225f0fe7faae353bd (diff)
downloadtracifyjs-099992ecae5ed51332f3928b9e1c06e7ad8147b8.tar.gz
tracifyjs-099992ecae5ed51332f3928b9e1c06e7ad8147b8.zip
Keep single line comments after nlb, after nlb
Fixes #583
-rw-r--r--lib/output.js9
1 files changed, 9 insertions, 0 deletions
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");