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