* Sets up a line cache with a ttl
()
| 48 | * Sets up a line cache with a ttl |
| 49 | */ |
| 50 | public initLinesCache(): void { |
| 51 | if (!this._linesCache) { |
| 52 | this._linesCache = new Array(this._terminal.buffer.active.length); |
| 53 | this._linesCacheDisposables.value = combinedDisposable( |
| 54 | this._terminal.onLineFeed(() => this._destroyLinesCache()), |
| 55 | this._terminal.onCursorMove(() => this._destroyLinesCache()), |
| 56 | this._terminal.onResize(() => this._destroyLinesCache()) |
| 57 | ); |
| 58 | } |
| 59 | |
| 60 | this._linesCacheTimeout.value = disposableTimeout(() => this._destroyLinesCache(), Constants.LINES_CACHE_TIME_TO_LIVE); |
| 61 | } |
| 62 | |
| 63 | private _destroyLinesCache(): void { |
| 64 | this._linesCache = undefined; |
no test coverage detected