(range: IBufferRange, excludeFinalCursorPosition?: boolean)
| 191 | constructor(protected readonly _buffer: IBuffer) {} |
| 192 | |
| 193 | public serialize(range: IBufferRange, excludeFinalCursorPosition?: boolean): string { |
| 194 | let oldCell = this._buffer.getNullCell() |
| 195 | |
| 196 | const startRow = range.start.y |
| 197 | const endRow = range.end.y |
| 198 | const startColumn = range.start.x |
| 199 | const endColumn = range.end.x |
| 200 | |
| 201 | this._beforeSerialize(endRow - startRow + 1, startRow, endRow) |
| 202 | |
| 203 | for (let row = startRow; row <= endRow; row++) { |
| 204 | const line = this._buffer.getLine(row) |
| 205 | if (line) { |
| 206 | const startLineColumn = row === range.start.y ? startColumn : 0 |
| 207 | const endLineColumn = Math.min(endColumn, line.length) |
| 208 | |
| 209 | for (let col = startLineColumn; col < endLineColumn; col++) { |
| 210 | const c = line.getCell(col) |
| 211 | if (!c) { |
| 212 | continue |
| 213 | } |
| 214 | this._nextCell(c, oldCell, row, col) |
| 215 | oldCell = c |
| 216 | } |
| 217 | } |
| 218 | this._rowEnd(row, row === endRow) |
| 219 | } |
| 220 | |
| 221 | this._afterSerialize() |
| 222 | |
| 223 | return this._serializeString(excludeFinalCursorPosition) |
| 224 | } |
| 225 | |
| 226 | protected _nextCell(_cell: IBufferCell, _oldCell: IBufferCell, _row: number, _col: number): void {} |
| 227 | protected _rowEnd(_row: number, _isLastRow: boolean): void {} |
nothing calls this directly
no test coverage detected