MCPcopy Create free account
hub / github.com/coder/ghostty-web / translateToString

Method translateToString

lib/buffer.ts:266–285  ·  view source on GitHub ↗
(trimRight = false, startColumn = 0, endColumn = this._length)

Source from the content-addressed store, hash-verified

264 }
265
266 translateToString(trimRight = false, startColumn = 0, endColumn = this._length): string {
267 // Clamp bounds
268 const start = Math.max(0, Math.min(startColumn, this._length));
269 const end = Math.max(start, Math.min(endColumn, this._length));
270
271 let result = '';
272 for (let x = start; x < end; x++) {
273 const cell = this.getCell(x);
274 if (cell) {
275 const chars = cell.getChars();
276 result += chars;
277 }
278 }
279
280 if (trimRight) {
281 result = result.trimEnd();
282 }
283
284 return result;
285 }
286}
287
288// ============================================================================

Callers

nothing calls this directly

Calls 2

getCellMethod · 0.95
getCharsMethod · 0.65

Tested by

no test coverage detected