beautify: don't add extra \n after comments

This commit is contained in:
tophf 2017-05-27 11:38:13 +03:00
parent ddc5cc0ccf
commit 8bbab9e0e1

View File

@ -401,17 +401,12 @@
if (!ch) { if (!ch) {
break; break;
} else if (ch === '/' && peek() === '*') { /* css comment */ } else if (ch === '/' && peek() === '*') { /* css comment */
var header = indentLevel === 0; if (isAfterNewline) {
if (isAfterNewline || header) {
print.newLine(); print.newLine();
} }
print.text(eatComment()); print.text(eatComment());
print.newLine(); print.newLine();
if (header) {
print.newLine(true);
}
} else if (ch === '/' && peek() === '/') { // single line comment } else if (ch === '/' && peek() === '/') { // single line comment
if (!isAfterNewline && last_top_ch !== '{') { if (!isAfterNewline && last_top_ch !== '{') {
print.trim(); print.trim();