Revert "extract _assertWebviewForMarkdownPreview"
This reverts commit e5afd67095
.
This commit is contained in:
parent
2c232fed6a
commit
15ba6b4c95
1 changed files with 49 additions and 9 deletions
|
@ -2052,7 +2052,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
|
|||
};
|
||||
}
|
||||
|
||||
private async _assertWebviewForMarkdownPreview() {
|
||||
async createMarkdownPreview(cell: MarkdownCellViewModel) {
|
||||
if (!this.useRenderer) {
|
||||
// TODO: handle case where custom renderer is disabled?
|
||||
return;
|
||||
|
@ -2065,10 +2065,6 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
|
|||
if (!this._webview.isResolved()) {
|
||||
await this._resolveWebview();
|
||||
}
|
||||
}
|
||||
|
||||
async createMarkdownPreview(cell: MarkdownCellViewModel) {
|
||||
await this._assertWebviewForMarkdownPreview();
|
||||
|
||||
if (!this._webview) {
|
||||
return;
|
||||
|
@ -2079,25 +2075,69 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
|
|||
}
|
||||
|
||||
async unhideMarkdownPreview(cell: MarkdownCellViewModel) {
|
||||
await this._assertWebviewForMarkdownPreview();
|
||||
if (!this.useRenderer) {
|
||||
// TODO: handle case where custom renderer is disabled?
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._webview) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._webview.isResolved()) {
|
||||
await this._resolveWebview();
|
||||
}
|
||||
|
||||
await this._webview?.unhideMarkdownPreview(cell.id);
|
||||
}
|
||||
|
||||
async hideMarkdownPreview(cell: MarkdownCellViewModel) {
|
||||
await this._assertWebviewForMarkdownPreview();
|
||||
if (!this.useRenderer) {
|
||||
// TODO: handle case where custom renderer is disabled?
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._webview) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._webview.isResolved()) {
|
||||
await this._resolveWebview();
|
||||
}
|
||||
|
||||
await this._webview?.hideMarkdownPreview(cell.id);
|
||||
}
|
||||
|
||||
async removeMarkdownPreview(cell: MarkdownCellViewModel) {
|
||||
await this._assertWebviewForMarkdownPreview();
|
||||
if (!this.useRenderer) {
|
||||
// TODO: handle case where custom renderer is disabled?
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._webview) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._webview.isResolved()) {
|
||||
await this._resolveWebview();
|
||||
}
|
||||
|
||||
await this._webview?.removeMarkdownPreview(cell.id);
|
||||
}
|
||||
|
||||
async updateMarkdownPreviewSelectionState(cell: ICellViewModel, isSelected: boolean): Promise<void> {
|
||||
await this._assertWebviewForMarkdownPreview();
|
||||
if (!this.useRenderer) {
|
||||
// TODO: handle case where custom renderer is disabled?
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._webview) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._webview.isResolved()) {
|
||||
await this._resolveWebview();
|
||||
}
|
||||
|
||||
await this._webview?.updateMarkdownPreviewSelectionState(cell.id, isSelected);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue