Skip to content

Commit

Permalink
Can't do regex search after opening notebook (#183884)
Browse files Browse the repository at this point in the history
Fixes #183858
  • Loading branch information
andreamah committed May 30, 2023
1 parent d1ae1ff commit 3370908
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
16 changes: 2 additions & 14 deletions src/vs/workbench/contrib/search/browser/searchFindInput.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 3370908

Please sign in to comment.