MCPcopy Index your code
hub / github.com/codeaashu/claude-code / scroll

Method scroll

src/server/web/public/terminal.js:5396–5409  ·  view source on GitHub ↗
(e3, t3 = false)

Source from the content-addressed store, hash-verified

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 }

Callers 4

scrollMethod · 0.45
printMethod · 0.45
lineFeedMethod · 0.45
indexMethod · 0.45

Calls 12

getFgMethod · 0.80
getBgMethod · 0.80
getBlankLineMethod · 0.80
copyFromMethod · 0.80
recycleMethod · 0.80
spliceMethod · 0.80
maxMethod · 0.80
shiftElementsMethod · 0.80
fireMethod · 0.80
pushMethod · 0.45
cloneMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected