Don't set overview ruler width when using find

An embedder may not want to enable it
This commit is contained in:
Daniel Imms
2022-03-21 16:34:48 -07:00
parent 23076ba6cc
commit f9deb2f840
@@ -92,7 +92,6 @@ export class SearchAddon implements ITerminalAddon {
private _disposeDecorations(): void { private _disposeDecorations(): void {
this._resultDecorations.forEach(decorations => { this._resultDecorations.forEach(decorations => {
for (const d of decorations) { for (const d of decorations) {
console.log('dispose', d);
d.dispose(); d.dispose();
} }
}); });
@@ -138,9 +137,6 @@ export class SearchAddon implements ITerminalAddon {
this._searchResults.set(`${result.row}-${result.col}`, result); this._searchResults.set(`${result.row}-${result.col}`, result);
result = this._find(term, result.row, result.col + 1, searchOptions); result = this._find(term, result.row, result.col + 1, searchOptions);
} }
if (!this._terminal.options.overviewRulerWidth) {
this._terminal.options.overviewRulerWidth = 10;
}
this._searchResults.forEach(result => { this._searchResults.forEach(result => {
const resultDecoration = this._createResultDecoration(result, searchOptions.decorations!); const resultDecoration = this._createResultDecoration(result, searchOptions.decorations!);
if (resultDecoration) { if (resultDecoration) {
@@ -644,7 +640,6 @@ export class SearchAddon implements ITerminalAddon {
if (!marker || !decorations?.matchColor) { if (!marker || !decorations?.matchColor) {
return undefined; return undefined;
} }
const findResultDecoration = terminal.registerDecoration( const findResultDecoration = terminal.registerDecoration(
{ marker, { marker,
overviewRulerOptions: this._resultDecorations.get(marker.line) && !this._dataChanged ? undefined : { color: decorations.matchColor, position: 'center' } overviewRulerOptions: this._resultDecorations.get(marker.line) && !this._dataChanged ? undefined : { color: decorations.matchColor, position: 'center' }