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

Method selectionText

src/server/web/public/terminal.js:2033–2057  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2031 return !(!e3 || !t3 || e3[0] === t3[0] && e3[1] === t3[1]);
2032 }
2033 get selectionText() {
2034 const e3 = this._model.finalSelectionStart, t3 = this._model.finalSelectionEnd;
2035 if (!e3 || !t3) return "";
2036 const i3 = this._bufferService.buffer, s3 = [];
2037 if (3 === this._activeSelectionMode) {
2038 if (e3[0] === t3[0]) return "";
2039 const r2 = e3[0] < t3[0] ? e3[0] : t3[0], n2 = e3[0] < t3[0] ? t3[0] : e3[0];
2040 for (let o2 = e3[1]; o2 <= t3[1]; o2++) {
2041 const e4 = i3.translateBufferLineToString(o2, true, r2, n2);
2042 s3.push(e4);
2043 }
2044 } else {
2045 const r2 = e3[1] === t3[1] ? t3[0] : void 0;
2046 s3.push(i3.translateBufferLineToString(e3[1], true, e3[0], r2));
2047 for (let r3 = e3[1] + 1; r3 <= t3[1] - 1; r3++) {
2048 const e4 = i3.lines.get(r3), t4 = i3.translateBufferLineToString(r3, true);
2049 (e4 == null ? void 0 : e4.isWrapped) ? s3[s3.length - 1] += t4 : s3.push(t4);
2050 }
2051 if (e3[1] !== t3[1]) {
2052 const e4 = i3.lines.get(t3[1]), r3 = i3.translateBufferLineToString(t3[1], true, 0, t3[0]);
2053 e4 && e4.isWrapped ? s3[s3.length - 1] += r3 : s3.push(r3);
2054 }
2055 }
2056 return s3.map(((e4) => e4.replace(p, " "))).join(d.isWindows ? "\r\n" : "\n");
2057 }
2058 clearSelection() {
2059 this._model.clearSelection(), this._removeMouseDownListeners(), this.refresh(), this._onSelectionChange.fire();
2060 }

Callers

nothing calls this directly

Calls 3

getMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected