Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't do regex search after opening notebook #183884

Merged
merged 1 commit into from May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 2 additions & 14 deletions src/vs/workbench/contrib/search/browser/searchFindInput.ts
Expand Up @@ -67,20 +67,8 @@ export class SearchFindInput extends ContextScopedFindInput {
!this.filters.codeInput ||
!this.filters.codeOutput;

// for now, allow the default state to enable regex, since it would be strange for regex to suddenly
// be disabled when a notebook is opened. However, since regex isn't supported for outputs, this should
// be revisted.
if (this.regex) {
if ((this.filters.markupPreview || this.filters.codeOutput) && this._filterChecked && this._visible) {
this.regex.disable();
this.regex.domNode.tabIndex = -1;
this.regex.domNode.classList.toggle('disabled', true);
} else {
this.regex.enable();
this.regex.domNode.tabIndex = 0;
this.regex.domNode.classList.toggle('disabled', false);
}
}
// TODO: find a way to express that searching notebook output and markdown preview don't support regex.

this._findFilter.applyStyles(this._filterChecked);
}
}
6 changes: 5 additions & 1 deletion src/vs/workbench/contrib/search/browser/searchModel.ts
Expand Up @@ -792,7 +792,11 @@ export class FileMatch extends Disposable implements IFileMatch {
webviewMatches: webviewMatches
};
});
this._findMatchDecorationModel.setAllFindMatchesDecorations(cellFindMatch);
try {
this._findMatchDecorationModel.setAllFindMatchesDecorations(cellFindMatch);
} catch (e) {
// no op, might happen due to bugs related to cell output regex search
}
}
async updateMatchesForEditorWidget(): Promise<void> {
if (!this._notebookEditorWidget) {
Expand Down