MCPcopy
hub / github.com/xtermjs/xterm.js / scrollLeft

Method scrollLeft

src/common/InputHandler.ts:1474–1486  ·  view source on GitHub ↗

* CSI Ps SP @ Scroll left Ps columns (default = 1) (SL) ECMA-48 * * Notation: (Pn) * Representation: CSI Pn 02/00 04/00 * Parameter default value: Pn = 1 * SL causes the data in the presentation component to be moved by n character positions * if the line orientation is horizontal

(params: IParams)

Source from the content-addressed store, hash-verified

1472 * SL has no effect outside of the scroll margins.
1473 */
1474 public scrollLeft(params: IParams): boolean {
1475 if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {
1476 return true;
1477 }
1478 const param = params.params[0] || 1;
1479 for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {
1480 const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;
1481 line.deleteCells(0, param, this._activeBuffer.getNullCell(this._eraseAttrData()));
1482 line.isWrapped = false;
1483 }
1484 this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);
1485 return true;
1486 }
1487
1488 /**
1489 * CSI Ps SP A Scroll right Ps columns (default = 1) (SR) ECMA-48

Callers 1

constructorMethod · 0.95

Calls 5

_eraseAttrDataMethod · 0.95
getMethod · 0.65
deleteCellsMethod · 0.65
getNullCellMethod · 0.65
markRangeDirtyMethod · 0.65

Tested by

no test coverage detected