Subtract one if line already ends with "{\n"
This commit is contained in:
parent
2e0cd0f349
commit
f592f95a68
@ -68,7 +68,6 @@ Buffer.prototype.removeLast = function (cha) {
|
||||
Buffer.prototype.newline = function (i, removeLast) {
|
||||
if (!this.buf) return;
|
||||
if (this.format.compact) return;
|
||||
if (this.endsWith("{\n")) return;
|
||||
|
||||
if (_.isBoolean(i)) {
|
||||
removeLast = i;
|
||||
@ -76,6 +75,7 @@ Buffer.prototype.newline = function (i, removeLast) {
|
||||
}
|
||||
|
||||
if (_.isNumber(i)) {
|
||||
if (this.endsWith("{\n")) i--;
|
||||
if (this.endsWith(util.repeat(i, "\n"))) return;
|
||||
|
||||
var self = this;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user