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

Method initLinesCache

addons/addon-search/src/SearchLineCache.ts:50–61  ·  view source on GitHub ↗

* Sets up a line cache with a ttl

()

Source from the content-addressed store, hash-verified

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;

Callers 5

findMethod · 0.80
findNextWithSelectionMethod · 0.80

Calls 6

_destroyLinesCacheMethod · 0.95
combinedDisposableFunction · 0.90
disposableTimeoutFunction · 0.90
onLineFeedMethod · 0.45
onCursorMoveMethod · 0.45
onResizeMethod · 0.45

Tested by

no test coverage detected