@xterm/addon-search 0.16.0-beta.119 → 0.16.0-beta.120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xterm/addon-search",
|
|
3
|
-
"version": "0.16.0-beta.
|
|
3
|
+
"version": "0.16.0-beta.120",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "The xterm.js authors",
|
|
6
6
|
"url": "https://xtermjs.org/"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"start": "node ../../demo/start"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@xterm/xterm": "^5.6.0-beta.
|
|
25
|
+
"@xterm/xterm": "^5.6.0-beta.120"
|
|
26
26
|
},
|
|
27
|
-
"commit": "
|
|
27
|
+
"commit": "ab01a5fd659671ccd5c8c45faa0afe354f09c759"
|
|
28
28
|
}
|
package/src/SearchAddon.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import type { Terminal, IDisposable, ITerminalAddon, IDecoration } from '@xterm/xterm';
|
|
7
7
|
import type { SearchAddon as ISearchApi } from '@xterm/addon-search';
|
|
8
|
-
import { Emitter } from 'vs/base/common/event';
|
|
8
|
+
import { Emitter, Event } from 'vs/base/common/event';
|
|
9
9
|
import { combinedDisposable, Disposable, dispose, MutableDisposable, toDisposable } from 'vs/base/common/lifecycle';
|
|
10
10
|
|
|
11
11
|
export interface ISearchOptions {
|
|
@@ -31,6 +31,11 @@ export interface ISearchPosition {
|
|
|
31
31
|
startRow: number;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
export interface ISearchResultChangeEvent {
|
|
35
|
+
resultIndex: number;
|
|
36
|
+
resultCount: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
export interface ISearchAddonOptions {
|
|
35
40
|
highlightLimit: number;
|
|
36
41
|
}
|
|
@@ -86,8 +91,8 @@ export class SearchAddon extends Disposable implements ITerminalAddon , ISearchA
|
|
|
86
91
|
private _linesCacheTimeoutId = 0;
|
|
87
92
|
private _linesCacheDisposables = new MutableDisposable();
|
|
88
93
|
|
|
89
|
-
private readonly _onDidChangeResults = this._register(new Emitter<
|
|
90
|
-
public
|
|
94
|
+
private readonly _onDidChangeResults = this._register(new Emitter<ISearchResultChangeEvent>());
|
|
95
|
+
public get onDidChangeResults(): Event<ISearchResultChangeEvent> { return this._onDidChangeResults.event; }
|
|
91
96
|
|
|
92
97
|
constructor(options?: Partial<ISearchAddonOptions>) {
|
|
93
98
|
super();
|
|
@@ -75,6 +75,21 @@ declare module '@xterm/addon-search' {
|
|
|
75
75
|
activeMatchColorOverviewRuler: string;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Event data fired when search results change.
|
|
80
|
+
*/
|
|
81
|
+
export interface ISearchResultChangeEvent {
|
|
82
|
+
/**
|
|
83
|
+
* The index of the currently active result, -1 when the threshold of matches is exceeded.
|
|
84
|
+
*/
|
|
85
|
+
resultIndex: number;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The total number of search results found.
|
|
89
|
+
*/
|
|
90
|
+
resultCount: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
78
93
|
/**
|
|
79
94
|
* Options for the search addon.
|
|
80
95
|
*/
|
|
@@ -139,8 +154,7 @@ declare module '@xterm/addon-search' {
|
|
|
139
154
|
/**
|
|
140
155
|
* When decorations are enabled, fires when
|
|
141
156
|
* the search results change.
|
|
142
|
-
* @returns -1 for resultIndex when the threshold of matches is exceeded.
|
|
143
157
|
*/
|
|
144
|
-
readonly onDidChangeResults: IEvent<
|
|
158
|
+
readonly onDidChangeResults: IEvent<ISearchResultChangeEvent>;
|
|
145
159
|
}
|
|
146
160
|
}
|