| 5394 | this.cols = e3, this.rows = t3, this.buffers.resize(e3, t3), this._onResize.fire({ cols: e3, rows: t3 }); |
| 5395 | } |
| 5396 | reset() { |
| 5397 | this.buffers.reset(), this.isUserScrolling = false; |
| 5398 | } |
| 5399 | scroll(e3, t3 = false) { |
| 5400 | const i3 = this.buffer; |
| 5401 | let s3; |
| 5402 | s3 = this._cachedBlankLine, s3 && s3.length === this.cols && s3.getFg(0) === e3.fg && s3.getBg(0) === e3.bg || (s3 = i3.getBlankLine(e3, t3), this._cachedBlankLine = s3), s3.isWrapped = t3; |
| 5403 | const r2 = i3.ybase + i3.scrollTop, n2 = i3.ybase + i3.scrollBottom; |
| 5404 | if (0 === i3.scrollTop) { |
| 5405 | const e4 = i3.lines.isFull; |
| 5406 | n2 === i3.lines.length - 1 ? e4 ? i3.lines.recycle().copyFrom(s3) : i3.lines.push(s3.clone()) : i3.lines.splice(n2 + 1, 0, s3.clone()), e4 ? this.isUserScrolling && (i3.ydisp = Math.max(i3.ydisp - 1, 0)) : (i3.ybase++, this.isUserScrolling || i3.ydisp++); |
| 5407 | } else { |
| 5408 | const e4 = n2 - r2 + 1; |
| 5409 | i3.lines.shiftElements(r2 + 1, e4 - 1, -1), i3.lines.set(n2, s3.clone()); |
| 5410 | } |
| 5411 | this.isUserScrolling || (i3.ydisp = i3.ybase), this._onScroll.fire(i3.ydisp); |
| 5412 | } |