}
} else { //prepending
if (start + newRows.length < this.startPos) {
- this.rows = newRows;
+ this.rows = newRows;
+ this.attr = newStyle;
} else {
this.rows = newRows.slice(0, this.startPos).concat(this.rows);
- if (this.maxBufferSize && this.rows.length > this.maxBufferSize)
+ if (newStyle) this.attr = newStyle.slice(0, this.startPos).concat(this.attr);
+ if (this.maxBufferSize && this.rows.length > this.maxBufferSize) {
this.rows = this.rows.slice(0, this.maxBufferSize);
+ if (this.attr) this.attr = this.attr.slice(0, this.maxBufferSize);
+ }
}
this.startPos = start;
}