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

Method _stringLengthToBufferSize

src/server/web/public/terminal.js:6549–6561  ·  view source on GitHub ↗
(e3, t3)

Source from the content-addressed store, hash-verified

6547 for (; s3 < c.length - 1 && f + e3.length >= c[s3 + 1]; ) s3++;
6548 const n3 = f - c[t4], h2 = f + e3.length - c[s3], a2 = this._stringLengthToBufferSize(o2 + t4, n3);
6549 return { term: e3, col: a2, row: o2 + t4, size: this._stringLengthToBufferSize(o2 + s3, h2) - a2 + r2.cols * (s3 - t4) };
6550 }
6551 }
6552 _stringLengthToBufferSize(e3, t3) {
6553 const i2 = this._terminal.buffer.active.getLine(e3);
6554 if (!i2) return 0;
6555 for (let e4 = 0; e4 < t3; e4++) {
6556 const s2 = i2.getCell(e4);
6557 if (!s2) break;
6558 const r2 = s2.getChars();
6559 r2.length > 1 && (t3 -= r2.length - 1);
6560 const o2 = i2.getCell(e4 + 1);
6561 o2 && 0 === o2.getWidth() && t3++;
6562 }
6563 return t3;
6564 }

Callers 1

_findInLineMethod · 0.95

Calls 4

getCellMethod · 0.80
getLineMethod · 0.45
getCharsMethod · 0.45
getWidthMethod · 0.45

Tested by

no test coverage detected