clearDecorations
This commit is contained in:
@@ -82,11 +82,11 @@ export class SearchAddon implements ITerminalAddon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public dispose(): void {
|
public dispose(): void {
|
||||||
this.clear();
|
this.clearDecorations();
|
||||||
this._onDataDisposable?.dispose();
|
this._onDataDisposable?.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public clear(): void {
|
public clearDecorations(): void {
|
||||||
this._selectedDecoration?.dispose();
|
this._selectedDecoration?.dispose();
|
||||||
this._terminal?.clearSelection();
|
this._terminal?.clearSelection();
|
||||||
this._searchResults.clear();
|
this._searchResults.clear();
|
||||||
@@ -116,7 +116,7 @@ export class SearchAddon implements ITerminalAddon {
|
|||||||
throw new Error('cannot find all matches with no terminal');
|
throw new Error('cannot find all matches with no terminal');
|
||||||
}
|
}
|
||||||
if (!term || term.length === 0) {
|
if (!term || term.length === 0) {
|
||||||
this.clear();
|
this.clearDecorations();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
searchOptions = searchOptions || {};
|
searchOptions = searchOptions || {};
|
||||||
@@ -160,7 +160,7 @@ export class SearchAddon implements ITerminalAddon {
|
|||||||
if (!this._terminal || !term || term.length === 0) {
|
if (!this._terminal || !term || term.length === 0) {
|
||||||
this._result = undefined;
|
this._result = undefined;
|
||||||
this._terminal?.clearSelection();
|
this._terminal?.clearSelection();
|
||||||
this.clear();
|
this.clearDecorations();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +244,7 @@ export class SearchAddon implements ITerminalAddon {
|
|||||||
if (!this._terminal || !term || term.length === 0) {
|
if (!this._terminal || !term || term.length === 0) {
|
||||||
this._result = undefined;
|
this._result = undefined;
|
||||||
this._terminal?.clearSelection();
|
this._terminal?.clearSelection();
|
||||||
this.clear();
|
this.clearDecorations();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,5 +64,10 @@ declare module 'xterm-addon-search' {
|
|||||||
* @param searchOptions The options for the search.
|
* @param searchOptions The options for the search.
|
||||||
*/
|
*/
|
||||||
public findPrevious(term: string, searchOptions?: ISearchOptions): boolean;
|
public findPrevious(term: string, searchOptions?: ISearchOptions): boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the decorations and selection
|
||||||
|
*/
|
||||||
|
public clearDecorations(): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user