Skip to content

Commit 3370908

Browse files
authored
Can't do regex search after opening notebook (microsoft#183884)
Fixes microsoft#183858
1 parent d1ae1ff commit 3370908

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

src/vs/workbench/contrib/search/browser/searchFindInput.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,8 @@ export class SearchFindInput extends ContextScopedFindInput {
6767
!this.filters.codeInput ||
6868
!this.filters.codeOutput;
6969

70-
// for now, allow the default state to enable regex, since it would be strange for regex to suddenly
71-
// be disabled when a notebook is opened. However, since regex isn't supported for outputs, this should
72-
// be revisted.
73-
if (this.regex) {
74-
if ((this.filters.markupPreview || this.filters.codeOutput) && this._filterChecked && this._visible) {
75-
this.regex.disable();
76-
this.regex.domNode.tabIndex = -1;
77-
this.regex.domNode.classList.toggle('disabled', true);
78-
} else {
79-
this.regex.enable();
80-
this.regex.domNode.tabIndex = 0;
81-
this.regex.domNode.classList.toggle('disabled', false);
82-
}
83-
}
70+
// TODO: find a way to express that searching notebook output and markdown preview don't support regex.
71+
8472
this._findFilter.applyStyles(this._filterChecked);
8573
}
8674
}

src/vs/workbench/contrib/search/browser/searchModel.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,11 @@ export class FileMatch extends Disposable implements IFileMatch {
792792
webviewMatches: webviewMatches
793793
};
794794
});
795-
this._findMatchDecorationModel.setAllFindMatchesDecorations(cellFindMatch);
795+
try {
796+
this._findMatchDecorationModel.setAllFindMatchesDecorations(cellFindMatch);
797+
} catch (e) {
798+
// no op, might happen due to bugs related to cell output regex search
799+
}
796800
}
797801
async updateMatchesForEditorWidget(): Promise<void> {
798802
if (!this._notebookEditorWidget) {

0 commit comments

Comments
 (0)