Skip to content

Commit 59041c8

Browse files
committed
Use an option over a protected override
1 parent 3640b74 commit 59041c8

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ interface IFindOptions {
3737
appendCaseSensitiveLabel?: string;
3838
appendRegexLabel?: string;
3939
appendWholeWordsLabel?: string;
40+
matchesLimit?: number;
4041
type?: 'Terminal' | 'Webview';
4142
}
4243

@@ -52,6 +53,7 @@ export abstract class SimpleFindWidget extends Widget {
5253
private readonly _updateHistoryDelayer: Delayer<void>;
5354
private readonly prevBtn: SimpleButton;
5455
private readonly nextBtn: SimpleButton;
56+
private readonly _matchesLimit: number;
5557
private _matchesCount: HTMLElement | undefined;
5658

5759
private _isVisible: boolean = false;
@@ -68,6 +70,8 @@ export abstract class SimpleFindWidget extends Widget {
6870
) {
6971
super();
7072

73+
this._matchesLimit = options.matchesLimit ?? Number.MAX_SAFE_INTEGER;
74+
7175
this._findInput = this._register(new ContextScopedFindInput(null, contextViewService, {
7276
label: NLS_FIND_INPUT_LABEL,
7377
placeholder: NLS_FIND_INPUT_PLACEHOLDER,
@@ -208,10 +212,6 @@ export abstract class SimpleFindWidget extends Widget {
208212
protected abstract _onFindInputFocusTrackerBlur(): void;
209213
protected abstract _getResultCount(): Promise<{ resultIndex: number; resultCount: number } | undefined>;
210214

211-
protected get _matchesLimit(): number {
212-
return Number.MAX_SAFE_INTEGER;
213-
}
214-
215215
protected get inputValue() {
216216
return this._findInput.getValue();
217217
}

src/vs/workbench/contrib/terminalContrib/find/browser/terminalFindWidget.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ export class TerminalFindWidget extends SimpleFindWidget {
1919
private _findWidgetFocused: IContextKey<boolean>;
2020
private _findWidgetVisible: IContextKey<boolean>;
2121

22-
override get _matchesLimit() { return XtermTerminalConstants.SearchHighlightLimit; }
23-
2422
constructor(
2523
private _instance: ITerminalInstance,
2624
@IContextViewService _contextViewService: IContextViewService,
@@ -29,7 +27,7 @@ export class TerminalFindWidget extends SimpleFindWidget {
2927
@IThemeService private readonly _themeService: IThemeService,
3028
@IConfigurationService private readonly _configurationService: IConfigurationService
3129
) {
32-
super({ showCommonFindToggles: true, checkImeCompletionState: true, showResultCount: true, type: 'Terminal' }, _contextViewService, _contextKeyService, keybindingService);
30+
super({ showCommonFindToggles: true, checkImeCompletionState: true, showResultCount: true, type: 'Terminal', matchesLimit: XtermTerminalConstants.SearchHighlightLimit }, _contextViewService, _contextKeyService, keybindingService);
3331

3432
this._register(this.state.onFindReplaceStateChange(() => {
3533
this.show();

0 commit comments

Comments
 (0)