mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-29 09:09:03 +01:00
Notebook Find widget doesn't remove decorations on empty query (#187749)
* Notebook Find widget doesn't remove decorations on empty query Fixes #187748 * send empty strings to find
This commit is contained in:
@@ -471,6 +471,9 @@ export class FindModel extends Disposable {
|
||||
}
|
||||
|
||||
private async _compute(token: CancellationToken): Promise<CellFindMatchWithIndex[] | null> {
|
||||
if (!this._notebookEditor.hasModel()) {
|
||||
return null;
|
||||
}
|
||||
let ret: CellFindMatchWithIndex[] | null = null;
|
||||
const val = this._state.searchString;
|
||||
const wordSeparators = this._configurationService.inspect<string>('editor.wordSeparators').value;
|
||||
@@ -485,13 +488,8 @@ export class FindModel extends Disposable {
|
||||
includeMarkupPreview: !!this._state.filters?.markupPreview,
|
||||
includeOutput: !!this._state.filters?.codeOutput
|
||||
};
|
||||
if (!val) {
|
||||
ret = null;
|
||||
} else if (!this._notebookEditor.hasModel()) {
|
||||
ret = null;
|
||||
} else {
|
||||
ret = await this._notebookEditor.find(val, options, token);
|
||||
}
|
||||
|
||||
ret = await this._notebookEditor.find(val, options, token);
|
||||
|
||||
if (token.isCancellationRequested) {
|
||||
return null;
|
||||
|
||||
@@ -1610,6 +1610,10 @@ export class BackLayerWebView<T extends ICommonCellInfo> extends Themable {
|
||||
|
||||
async find(query: string, options: { wholeWord?: boolean; caseSensitive?: boolean; includeMarkup: boolean; includeOutput: boolean; shouldGetSearchPreviewInfo: boolean; ownerID: string }): Promise<IFindMatch[]> {
|
||||
if (query === '') {
|
||||
this._sendMessageToWebview({
|
||||
type: 'findStop',
|
||||
ownerID: options.ownerID
|
||||
});
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user