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

Method _mapStrIdx

src/server/web/public/terminal.js:6253–6271  ·  view source on GitHub ↗
(e3, t3, n3, o3)

Source from the content-addressed store, hash-verified

6251 }
6252 for (a.push(e4), i = 0; (n3 = t3.buffer.active.getLine(++r)) && n3.isWrapped && i < 2048 && (s = n3.translateToString(true), i += s.length, a.push(s), -1 === s.indexOf(" ")); ) ;
6253 }
6254 return [a, o3];
6255 }
6256 static _mapStrIdx(e3, t3, n3, o3) {
6257 const r = e3.buffer.active, i = r.getNullCell();
6258 let s = n3;
6259 for (; o3; ) {
6260 const e4 = r.getLine(t3);
6261 if (!e4) return [-1, -1];
6262 for (let n4 = s; n4 < e4.length; ++n4) {
6263 e4.getCell(n4, i);
6264 const s2 = i.getChars();
6265 if (i.getWidth() && (o3 -= s2.length || 1, n4 === e4.length - 1 && "" === s2)) {
6266 const e5 = r.getLine(t3 + 1);
6267 e5 && e5.isWrapped && (e5.getCell(0, i), 2 === i.getWidth() && (o3 += 1));
6268 }
6269 if (o3 < 0) return [t3, n4];
6270 }
6271 t3++, s = 0;
6272 }
6273 return [t3, s];
6274 }

Callers 1

computeLinkMethod · 0.80

Calls 5

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

Tested by

no test coverage detected