Fix find highlight on cell edits (#22080)

* update the rendered text onCellSourceChange

* fix test

* fix highlight in split mode

* update corresponding test

* update hasEditor with getEditor

* update event

* add comment
This commit is contained in:
Maddy
2023-03-08 22:26:07 -08:00
committed by GitHub
parent 87defc0367
commit 5fc69a0445
6 changed files with 29 additions and 22 deletions

View File

@@ -92,6 +92,7 @@ export class CellModel extends Disposable implements ICellModel {
private _lastEditMode: string | undefined;
public richTextCursorPosition: ICaretPosition | undefined;
public markdownCursorPosition: IPosition | undefined;
public cellPreviewUpdated = new Emitter<void>();
constructor(cellData: nb.ICellContents,
private _options: ICellModelOptions,
@@ -509,6 +510,10 @@ export class CellModel extends Disposable implements ICellModel {
this._cellSourceChanged = val;
}
public get onCellPreviewUpdated(): Event<void> {
return this.cellPreviewUpdated.event;
}
public get onParameterStateChanged(): Event<boolean> {
return this._onParameterStateChanged.event;
}

View File

@@ -6,7 +6,7 @@
// This code is based on @jupyterlab/packages/apputils/src/clientsession.tsx
import { nb } from 'azdata';
import { Event } from 'vs/base/common/event';
import { Emitter, Event } from 'vs/base/common/event';
import { IDisposable } from 'vs/base/common/lifecycle';
import { URI } from 'vs/base/common/uri';
import { INotificationService } from 'vs/platform/notification/common/notification';
@@ -456,6 +456,8 @@ export interface ICellModel {
readonly onCollapseStateChanged: Event<boolean>;
readonly onParameterStateChanged: Event<boolean>;
readonly onCellEditModeChanged: Event<boolean>;
readonly onCellPreviewUpdated: Event<void>;
readonly cellPreviewUpdated: Emitter<void>;
modelContentChangedEvent: IModelContentChangedEvent;
isEditMode: boolean;
showPreview: boolean;