提交 d9b9cfec 编写于 作者: R rebornix

Reveal range after editor is initialized.

上级 b8840e41
......@@ -226,4 +226,9 @@ export class NotebookFindWidget extends SimpleFindReplaceWidget {
this._allMatchesDecorations = accessor.deltaDecorations(this._allMatchesDecorations, deltaDecorations);
});
}
clear() {
this._currentMatch = -1;
this._findMatches = [];
}
}
......@@ -317,6 +317,7 @@ export class NotebookEditor extends BaseEditor implements INotebookEditor {
this.notebookViewModel = undefined;
this.webview?.clearInsets();
this.webview?.clearPreloadsCache();
this.findWidget.clear();
}
private async attachModel(input: NotebookEditorInput, model: NotebookEditorModel) {
......@@ -563,6 +564,7 @@ export class NotebookEditor extends BaseEditor implements INotebookEditor {
}
async deleteNotebookCell(cell: ICellViewModel): Promise<void> {
(cell as CellViewModel).save();
const index = this.notebookViewModel!.getViewCellIndex(cell);
await this.notebookService.deleteNotebookCell(this.notebookViewModel!.viewType, this.notebookViewModel!.uri, index);
this.notebookViewModel!.deleteCell(index, true);
......
......@@ -252,7 +252,9 @@ export class NotebookCellList extends WorkbenchList<CellViewModel> implements ID
this.view.setScrollTop(lineOffsetInView - this.view.renderHeight / 2);
if (revealType === CellRevealType.Range) {
element.revealRangeInCenter(range);
setTimeout(() => {
element.revealRangeInCenter(range);
}, 240);
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册