Change:
Type: <bBug</ba jupyter notebook, create a python cell the cell the notebook two earch results the notebook bug One of the search results goes away <img width="1179" alt="Screenshot 2023-04-25 at 11 09 04 AM" src="https://user-"Making any changes to the search term makes both search results show again VS Code version: Code - Insiders 1.78.0-insider (Universal) (, 2023-04-25T05:41:22.331Z) OS version: Darwin x64 22.4.0 Modes: Sandboxed: Yes <details<summarySystem Info</summary </details<!-- generated by issue reporter --

Discussion:
// make sure that the webview is not visible otherwise users will see pre-rendered markdown cells in wrong position as the list view doesn't have a correct `top` offset yet this._webview!.element.style.visibility = 'hidden'; // warm up can take around 200ms to load markdown libraries, etc. <del> await this._warmupViewport(viewModel, viewState); </del> <ins> await this._warmupViewportMarkdownCells(viewModel, viewState); </ins> this.logService.debug('NotebookEditorWidget', 'warmup - viewport warmed up'); // todo@rebornix @mjbvz, is this too complicated?

this._onDidAttachViewModel.fire(); } <del> private async _warmupViewport(viewModel: NotebookViewModel, viewState: INotebookEditorViewState | undefined) { </del> <ins> private async _warmupViewportMarkdownCells(viewModel: NotebookViewModel, viewState: INotebookEditorViewState | undefined) { </ins> if (viewState && viewState.cellTotalHeights) { const totalHeightCache = viewState.cellTotalHeights; const scrollTop = viewState.scrollPosition?.top ?? 0;

} const result: IInsetRenderOutput = { type: RenderOutputType.Extension, renderer, source: output, mimeType: pickedMimeTypeRenderer.mimeType }; <del> if (!this._webview?.insetMapping.has(result.source)) { </del> <ins> const inset = this._webview?.insetMapping.get(result.source); if (!inset || !inset.initialized) { </ins> const p = new Promise<void>(resolve => { this._register(Event.any(this.onDidRenderOutput, this.onDidRemoveOutput)(e => { if (e.model === result.source.model) {

cellInfo: K; renderer?: INotebookRendererInfo; cachedCreation: ICreationRequestMessage; <ins> initialized?: boolean; </ins> } export interface IResolvedBackLayerWebview {

this.reversedPendingWebviewIdleInsetMapping.delete(update.id); } <ins> { if (!update.init) { return; } const output = this.reversedInsetMapping.get(update.id); if (!output) { return; } const inset = this.insetMapping.get(output)!; inset.initialized = true; } </ins> } else { this.notebookEditor.updateMarkupCellHeight(update.id, height, !!update.init); }

private disposePastResults: () => void = () => { }; private _isDirty = false; private _onWillChangeModelListener: IDisposable | undefined; <ins> private _onDidChangeModelListener: IDisposable | undefined; </ins> constructor( private _searchModel: SearchModel,

} ); <del> widget.onDidChangeModel( (model) => { if (model) { this.onNotebookEditorWidgetAdded(widget, model?.uri); </del> <ins> this._onDidChangeModelListener?.dispose(); // listen to view model change as we are searching on both inputs and outputs this._onDidChangeModelListener = widget.onDidAttachViewModel( () => { if (widget.hasModel()) { this.onNotebookEditorWidgetAdded(widget, widget.textModel.uri); </ins> } } ); } private onModelAdded(model: ITextModel): void {

override dispose(): void { this._onWillChangeModelListener?.dispose(); <ins> this._onDidChangeModelListener?.dispose(); </ins> this.disposePastResults(); this.disposeMatches(); this._rangeHighlightDecorations.dispose();